Skip to content

Commit

Permalink
💡
Browse files Browse the repository at this point in the history
  • Loading branch information
transitive-bullshit committed Sep 4, 2024
1 parent 1e86b74 commit e2baf52
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/generators/arc4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class ARC4RNG extends RNG {

// For more robust unpredictability, the function call below discards an
// initial batch of values. This is called RC4-drop.
this.g(768)
this.g(256)
}

override get name() {
Expand Down
8 changes: 4 additions & 4 deletions src/seed.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ test('random.clone with string seed is consistent', () => {

test('Random constructor', () => {
const rng = new Random()
expect(rng).toBeDefined()
expect(rng.rng.name).toEqual('Math.random')

const rng2 = new Random(seedrandom('my-seed-string'))
expect(rng2).toBeDefined()
expect(rng2.rng.name).toEqual('prng')

const rng3 = new Random(Math.random)
expect(rng3).toBeDefined()
expect(rng3.rng.name).toEqual('random')

const rng4 = new Random('example-seed-string')
expect(rng4).toBeDefined()
expect(rng4.rng.name).toEqual('arc4')
})

test('random seed consistency', () => {
Expand Down

0 comments on commit e2baf52

Please sign in to comment.