EDIT: OK, I see the problem...: get_int(a[4],b[5]); won't work, while get_int(a,b); is fine. <_< That's the bug.
..and return(a,b); doesn't want to compile...I guess that's C. ...That's basically it. You can disregard thread from here on:
------------->8--------------------
Yeah, passing arrays as arguments doesn't work at the moment. Implementation isn't complete.
I'm getting another problem also.
int dir[33];
int counter[33];
When an ffc enemy is created what I do is initialize the variables for that enemy type, in a single frame, and then never again untill another enemy is created.
if(!init){
if(tx<120)dir[f]=3;else if(tx>120)dir[f]=2;
init=true;enemy->CSet=0;this->CSet=0;
enemy->HP=enemyHP;counter[f]=20+Rand(40);Trace(dir[f]);Trace(counter[f]);
}
..But look at this:
21.0000
21.0000
47.0000
47.0000
38.0000
38.0000
57.0000
57.0000
53.0000
53.0000
29.0000
29.0000
33.0000
33.0000
23.0000
23.0000
39.0000
39.0000
40.0000
40.0000
43.0000
43.0000
Since dir can never be any thing but 0-7, why is it copying data from one array to the other?
I think this explains why my Freeze type options are buggy as well.
Disregard everything beyond the first few lines of the first post.
After I figured out exactly what the problem was, it was basically this:
myInt = myFunction(array[i]);
You cannot use variables stored in an array as an argument.
Gleeok wrote:..and return(a,b); doesn't want to compile...
What would that even mean? This ain't Lua, we only have one return value per function.
pkmnfrk wrote:What would that even mean? This ain't Lua, we only have one return value per function.
Yes, well, back then I just as well assumed all Programming languages let you return multiple values. You see, you, as a programmer have simply accepted this as the norm, but I think it's stupid. 😛
edit: You don't think
x,y = Function(x,y);
would be invaluable to any language?
Maybe, but C was designed during the days when a program was pushing the size limits at 4 Kb. two return values?! What, you think we have the space for the instructions to copy them both out?!
And, if we have an arbitrary amount of return values, then it becomes quite a bit harder for the compiler to ignore them if we don't use them. Or, what about this:
int foo() {
return 1,2;
}//...
x,y,z = foo();
Where does the third number come from?