I found out the built in Kyma ‘anOrderedCollection shuffle’ was not seedable, so I came up with this block closure that does it.
| panPositions shuffler |
panPositions := ?panPositions asOrderedCollection.
shuffler := [:coll |
|n k r|
n := coll size.
r := Random new seededWith: ?seed.
[ n > 1 ] whileTrue: [
k := r nextIntegerBetween: 1 and: n.
coll swap: n with: k.
n := n – 1.
]
].
?shufflePanPositions varIfTrue: [
shuffler value: panPositions .
]
ifFalse: [ nil ].
“self debug: panPositions.”
(inputs at: 1)
start: 0 s
panPositions: panPositions