diff --git a/src/english/engine.test.ts b/src/english/engine.test.ts index 3368659..71c2689 100644 --- a/src/english/engine.test.ts +++ b/src/english/engine.test.ts @@ -214,6 +214,36 @@ describe('tricky move', () => { }); }); +describe('tricky move 2', () => { + let engine: EnglishDraughtsEngine; + + beforeEach(() => { + engine = EngineFactory.setup({ + board: { + light: S[12], + dark: S[31], + king: 0, + }, + player: DraughtsPlayer.DARK, + }); + }); + + test('correct moves', () => { + assert.sameDeepMembers(engine.moves, [ + { + origin: S[31], + destination: S[30], + captures: 0, + }, + { + origin: S[31], + destination: S[24], + captures: 0, + }, + ]); + }); +}); + describe('simple jump', () => { let engine: EnglishDraughtsEngine; diff --git a/src/english/utils.ts b/src/english/utils.ts index 10e44d2..1691eb8 100644 --- a/src/english/utils.ts +++ b/src/english/utils.ts @@ -27,7 +27,7 @@ export function decomposeBits(value: number): number[] { const split: number[] = []; for (let bit = 1; value; bit <<= 1) { if (value & bit) { - split.push(bit); + split.push(bit >>> 0); value ^= bit; } }