Programming V3 MEGATHREAD [Because we need one]

Author Topic: Programming V3 MEGATHREAD [Because we need one]  (Read 6606 times)

thats pretty hard actually. cant understand half of it

I managed to get it working for at least 40% of the marks (K <= 100 & K <= 1000) but the other ones (K <= 1,000,000,000) would not have worked, because I literally used a 2D array to store the tint of the entire area of glass.

I have an extensive language of G-Code. It's used in CNC Machining, basically for creating 3D models with hundreds of thousands of lines of code then transferring the code to a computer that operates a machine to cut those models in real life. Similar to 3D printing. I could make better models using G-Code than the best BL modelers. Not surprising though considering how precise it is. But yeah it needs to be recognized more.
Yea I don't think it's a real programming language in the same way as all these others. Before you ask, yes I do know gcode. It's just a points system for the mill to follow, there's not a lot of actual logic. You can't make anything complicated with hand code (unless you're a stubborn jackass). So instead, most people compile gcode straight from a model, which is more about "modeling" and less "programming"

Another note about being precise: you can only be as precise add the mill can be. I don't know why you bothered comparing to BL models, they're two completely different mediums and regardless you're wrong, a virtual model can have infinitely more precise modeling because it isn't involved in the physical limitations of the real world
« Last Edit: February 26, 2014, 04:39:13 PM by Treynolds416 »

im trying to learn the basics of php right now



am i doing anything right,,,,,,

Another note about being precise: you can only be as precise add the mill can be. I don't know why you bothered comparing to BL models, they're two completely different mediums and regardless you're wrong, a virtual model can have infinitely more precise modeling because it isn't involved in the physical limitations of the real world

Because he was trying to stroke his richard

Floating point arithmetic is weird. 0.1+0.1≠0.2 because 0.1 is actually 0.001100110011.... Because twos work, I was able to make a program that took 2^big number and count digits by converting to a string, and it gave the right answer (2^big number was greater than 128 bits). When I tried doing 100!, I couldn't do it that way because of floating point. I am trying to do 100! by lattice, so that my max product/sum is about 100. The problem is it will probably be slow, and adding diagonals is hard.

jesus forget why is lua so hard for me to learn?

jesus forget why is lua so hard for me to learn?

Lua was so easy.

Lua was so easy.
Yeah, except there are too many words. I like symbol based more than word based, and things like if then(x and y) versus if(x && y) is annoying.

Yeah, except there are too many words. I like symbol based more than word based, and things like if then(x and y) versus if(x && y) is annoying.

I would prefer symbols too.
But using then and end is so annoying as apposed to {}. Python just makes me sdhfgio8sdyufnsdlakjfads at this though.
« Last Edit: February 28, 2014, 09:38:55 PM by Steve5451² »

I would prefer symbols too.
But using then and end is so annoying as apposed to {}. Python just makes me sdhfgio8sdyufnsdlakjfads at this though.
Yeah. Pythons lists for me are annoying. They are a combination of C++ vectors and arrays. The fact you put it all in [] instead of {} is a first. Also, vectors are very useful but the just take a bit to get used to because of all the new abilities.

Code: (python) [Select]
for item in list:
    print item

vs

Code: (torquestuff) [Select]
for(%i = 0; %i < list.getCount(); %i++)
{
    echo(list.getObject(%i));
}

i think we can agree python is significantly better than torquescript (which isn't what you were saying but I was drawing a hyperbole and stuff)

i don't understand how anyone can have trouble with python, i think it's one of the easiest languages out there...

I've been a completete noob at Torquescript today.
I haven't used Torque for 5 months, and during that time I used Java very heavily. So let me tell you the story:

I made an add-on called "System_HammerHost" today, which communicates with the HammerHost control panel server, and you would not believe how stupid my initial code was.
Instead of using switch$ keywords, I used switch. Also, I used "+" signs instead of "@" signs by accident. I confused Java syntax with Torque script syntax. Worst of all, I used == to compare strings instead of $=. That and the plus signs made me waste 20 minutes trying to search for syntax errors when "String always evaluates to 0" errors spammed the console.

I was so used to Java that I did not notice the "+" signs were not used for concatenating strings. What an idiot I was.

Additionally, I used break; statements inside cases in switches. No wonder the console was spammed with "Break outside of loop...ignoring" errors. Occasionally, I forgot to put "%" and "$" signs in front of variables (since you don't use those in Java), and even goofed off so much that I declared a variable like this:
Code: [Select]
int $hhcp_chatListenCount = 0;

And to top it all of, I thought serverCmdchatMessage() was the server-command-function for sending chat messages, although it's really serverCmdmessageSent(). Yet another stupid mistake I made was forgetting to put the parented serverCmdmessageSent() function inside a package.

So looks like I forgot all my prior Torquescript knowledge from early-mid 2013, and need to brush up on it.
Does anybody else confuse multiple languages? Fortunately, I am lucky to not confuse HTML, CSS, Javascript, and Java with each other. It's just the percentage and dollar signs which drive me crazy.
« Last Edit: February 28, 2014, 10:03:23 PM by Hammereditor5 »

Worst of all, I used == to compare strings instead of $=.
Psst, you can't compare strings with == in Java either. ;)

Code: (python) [Select]
for item in list:
    print item

vs

Code: (torquestuff) [Select]
for(%i = 0; %i < list.getCount(); %i++)
{
    echo(list.getObject(%i));
}

i think we can agree python is significantly better than torquescript (which isn't what you were saying but I was drawing a hyperbole and stuff)

i don't understand how anyone can have trouble with python, i think it's one of the easiest languages out there...

Well Python is dummied down pretty far and that's nice, but it's just too much for me.