Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
9
Task/Knuth-shuffle/SenseTalk/knuth-shuffle.sensetalk
Normal file
9
Task/Knuth-shuffle/SenseTalk/knuth-shuffle.sensetalk
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
set list to 1..9 -- a range, will become a list as needed
|
||||
set last to the number of items in list
|
||||
|
||||
repeat with i = last down to 2 -- in SenseTalk, the first index in a list is 1
|
||||
set j = random (1,i-1)
|
||||
set [item i of list, item j of list] to [item j of list, item i of list] -- swap items
|
||||
end repeat
|
||||
|
||||
put list
|
||||
Loading…
Add table
Add a link
Reference in a new issue