this is where i first came across the "harlem shuffle" -
http://groups.google.com/group/macro...b71816b688db0f
for a fuller explanation, try googling for years as i have done ( if you ever find one, let me know) or try to make sense of trace outs -
Code:arr1=[1,2,3,4,5,6];; arr2 = [1,2,3,4,5,6,7,8,9]; function shuffle(){ nVal = Math.floor(Math.random()*3)-1; return nVal; }; chk = 0; function tracer(){ ++chk>arr2.length ? clearInterval(traceInt) : null; num = Math.floor(Math.random()*3)-1; arr1.sort(num); trace("num = "+num+" returns - "+arr1); arr2.sort(shuffle); trace("nVal = "+nVal+" returns - "+arr2); } traceInt = setInterval(tracer,50);




Reply With Quote