Fast, clean, non-duplicating array randomiser. This rules.
Courtesy: J Stadolnik.Code:shuffle(int cards) { int x,tmp; x=cards; while(x--) CARDS[x]=x%52; while(cards) { x=random(cards--); tmp=CARDS[cards]; CARDS[cards]=CARDS[x]; CARDS[x]=tmp; } }
|
Results 1 to 8 of 8
Thread: You horny little thing, you!Threaded View
|
Click Here to Expand Forum to Full Width |