Ralgoth your cycle2 has a logical problem...
len = 10Code:function cycle2(len:uint,position:int):uint { if(position < 0) position = len + -position; return position%len; }
position = -1
position = len + -position == 11
11%10 = 1
but position -1 should correspond to item [9] in the array.
What about:
///edit: alright I think I finally got it, I'm too wasted to be doing this at 12:30 am...Code://edit: //edit #3. argh: position = position<0 ? len-(-position%len) : position%len;
///edit #47, I think I just reproduced what Moagrius did like six posts ago by trial and error. Just shoot me please.




Reply With Quote
