Merge pull request 'Fix randrun and deps including shuffle. Fixes #1441' (#1447) from fix-randrun into main

Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1447
This commit is contained in:
Alex McLean 2025-07-05 12:53:44 +02:00
commit acd5661106
2 changed files with 25 additions and 25 deletions

View file

@ -264,7 +264,7 @@ export const randrun = (n) => {
const rands = timeToRands(t.floor().add(0.5), n);
const nums = rands
.map((n, i) => [n, i])
.sort((a, b) => a[0] > b[0] - a[0] < b[0])
.sort((a, b) => (a[0] > b[0]) - (a[0] < b[0]))
.map((x) => x[1]);
const i = t.cyclePos().mul(n).floor() % n;
return nums[i];