File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -214,6 +214,36 @@ describe('tricky move', () => {
214214 } ) ;
215215} ) ;
216216
217+ describe ( 'tricky move 2' , ( ) => {
218+ let engine : EnglishDraughtsEngine ;
219+
220+ beforeEach ( ( ) => {
221+ engine = EngineFactory . setup ( {
222+ board : {
223+ light : S [ 12 ] ,
224+ dark : S [ 31 ] ,
225+ king : 0 ,
226+ } ,
227+ player : DraughtsPlayer . DARK ,
228+ } ) ;
229+ } ) ;
230+
231+ test ( 'correct moves' , ( ) => {
232+ assert . sameDeepMembers ( engine . moves , [
233+ {
234+ origin : S [ 31 ] ,
235+ destination : S [ 30 ] ,
236+ captures : 0 ,
237+ } ,
238+ {
239+ origin : S [ 31 ] ,
240+ destination : S [ 24 ] ,
241+ captures : 0 ,
242+ } ,
243+ ] ) ;
244+ } ) ;
245+ } ) ;
246+
217247describe ( 'simple jump' , ( ) => {
218248 let engine : EnglishDraughtsEngine ;
219249
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ export function decomposeBits(value: number): number[] {
2727 const split : number [ ] = [ ] ;
2828 for ( let bit = 1 ; value ; bit <<= 1 ) {
2929 if ( value & bit ) {
30- split . push ( bit ) ;
30+ split . push ( bit >>> 0 ) ;
3131 value ^= bit ;
3232 }
3333 }
You can’t perform that action at this time.
0 commit comments