cubing / cubing.js

🛠 A library for displaying and working with twisty puzzles. Also currently home to the code for Twizzle.
https://js.cubing.net/cubing/
GNU General Public License v3.0
248 stars 45 forks source link

Scramble seeding #174

Open llGaetanll opened 2 years ago

llGaetanll commented 2 years ago

I've noticed that there is no way to seed scrambles using cubing/scramble.

Something like this would be very useful

const SEED = 1645390854477;
const s1 = await randomScrambleForEvent("333", SEED) // reproducible scramble

Are there any plans of implementing something like this?

lgarron commented 2 years ago

My instinct is that this is a big footgun — everyone should be using unpredictable, fully fair and random scrambles. There are lots of historical examples where someone thought they were getting random scrambles but weren't really — and I want to make it really hard to do that by accident.

If you need predictable scrambles, you should generally be either saving something precomputed.

Do you have any particular use cases in mind where this would be valuable and pre-computing some scrambles isn't feasible?

(Sorry for the delay — I just realized I haven't been getting notifications for new issues at all!)