Randomize a List problem
|
09-16-2020, 11:00 PM
(This post was last modified: 09-17-2020 05:07 PM by David Hayden.)
Post: #19
|
|||
|
|||
RE: Randomize a List problem
[ Edit: fixed some typos that Albert Chan pointed out in a private message. Thanks Albert! ]
You can swap level 1 with level N with Code: N PICK SWAP N UNPICK Code: N PICK SWAP N UNPICK @ swap level n and level 1 Code: IF N M < THEN @ EDIT: < should be ≠ With that, you can efficiently sort a list with [ EDIT: "sort" should be "shuffle" ] Code: « |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: