Shuffling agents - 2nd iteration
k=6
j=7
temp=
k=5
j=7
j=7
temp=
k = [...getIntegerWithMin: 0 withMax: j-1];
j--
temp = [list atOffset: k];
[list atOffset: k put: [list atOffset: j]];
[list atOffset: j put: temp];
6
0
1
2
3
4
8
7
5
7
0
1
2
3
4
8
7
5
7
0
1
2
3
4
8
6
5
6
6
6
0
1
2
3
4
8
7
5
Previous slide
Next slide
Back to first slide
View graphic version