Jump to content

Knuth shuffle: Difference between revisions

m
Line 2,180:
count = len(mutArr)
for i = 0count-1 to count1 step -1
cln j = arc4random_uniformrnd(i+1);-1
MutableArrayExchangeObjects( mutArr, i, j )
next
Line 2,190:
CFMutableArrayRef mutArr
NSUInteger i
mutArr = fn MutableArrayWithObjects( @0, @1, @2, @3, @4, @5, @6, @7, @8, @9, NULL )
NSLog( @"Before shuffle: %@", fn ArrayComponentsJoinedByString( mutArr, @"" ) )
 
717

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.