Skip to content

Commit

Permalink
fixup! [WIP] update odds function to use bit masks
Browse files Browse the repository at this point in the history
  • Loading branch information
mhuggins committed May 13, 2024
1 parent 66279bf commit eefdf8a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/__tests__/simulate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@ describe('simulate', () => {
for (let i = 0; i < 3; i += 1) {
const { value: odds } = generate.next();
expect(odds[0].total).toEqual(i + 1);
expect(odds.reduce((acc, current) => acc + current.equity, 0)).toBe(1);
}
});

it('calculates equities correctly', () => {
const generate = simulate(options);
for (let i = 0; i < 100; i += 1) {
const { value: odds } = generate.next();
expect(odds.reduce((acc, current) => acc + current.equity, 0)).toBeCloseTo(1);
}
});

Expand Down

0 comments on commit eefdf8a

Please sign in to comment.