| 02-26-2004, 01:39 AM | #1 |
Is there a way I can make 84 loops using 1 looper? instead of making 84 nested loops? LOL. Like a Loop X Would this give me really 84 local integers (85 including 0)? Or can locals not have arrays? Code:
Loop
exitwhen x > 84
local integer str[x] = 0
<actions>
Endloop |
| 02-26-2004, 01:52 AM | #2 |
Local declaration must be done at the beggining of the function. Anyway I'm not really sure why you would want 84 loops inside each other in side another loop as that horribly increases the time your function runs and causes it to have an absurd amortirized time of O(n^85) (for just two elements you will have the insane time of 386856227668133590597632!!! and know war3 thread problem would of died sometime before you even past through your first element) Where as the slowest sorting algorithm like buble sort have an O(n^2). As far as what you want wouldn't this work? Code:
function f takes parameters p returns type
local integer array str
local integer x=0
<rest of local declarations>
<pre loop funcs>
loop
exitwhen x>84
set str[x]=0
<actions inside of loop>
set x=x+1
endloop
<rest of actions of func>
endfunction |
