Skip to content

Is there a way to go back steps and repeat them? #79

@danzen

Description

@danzen

Not sure if saving the state is how to do this. I want to be able to go back a number of steps and repeat the random numbers again from there. So:

const r = seedrandom(100000);
console.log(Math.random(), Math.random(), Math.random()); // .78, .55. .13 // shortened ;-)
r.step(-3);
console.log(Math.random(), Math.random(), Math.random()); // .78, .55. .13

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions