green all capture tests
This commit is contained in:
parent
1a1e5121d7
commit
e9d94d1fad
2 changed files with 14 additions and 14 deletions
|
@ -197,7 +197,7 @@ const Game = ({gameData = {}, gameRecord = []} = {}) => ({
|
||||||
|| ( game.turn === -1 && player === 'white' );
|
|| ( game.turn === -1 && player === 'white' );
|
||||||
if (isTurn) {
|
if (isTurn) {
|
||||||
if (point.legal) {
|
if (point.legal) {
|
||||||
game = point.makeMove(game);
|
point.makeMove(game);
|
||||||
game.turn *= -1;
|
game.turn *= -1;
|
||||||
success = true;
|
success = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -273,7 +273,7 @@ describe('makeMove group join and capture logic', () => {
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
const multiCaptureGame = Game().initGame()
|
const multiCaptureGame = () => Game().initGame()
|
||||||
.makeMove({ player: 'black', pos: { x: 4, y: 17 } })
|
.makeMove({ player: 'black', pos: { x: 4, y: 17 } })
|
||||||
.makeMove({ player: 'white', pos: { x: 3, y: 16 } })
|
.makeMove({ player: 'white', pos: { x: 3, y: 16 } })
|
||||||
.makeMove({ player: 'black', pos: { x: 5, y: 16 } })
|
.makeMove({ player: 'black', pos: { x: 5, y: 16 } })
|
||||||
|
@ -290,26 +290,26 @@ describe('makeMove group join and capture logic', () => {
|
||||||
.makeMove({ player: 'black', pos: { x: 6, y: 3 } });
|
.makeMove({ player: 'black', pos: { x: 6, y: 3 } });
|
||||||
|
|
||||||
it('smoke test multi stone group capture', done => {
|
it('smoke test multi stone group capture', done => {
|
||||||
multiCaptureGame.makeMove({ player: 'white', pos: { x: 6, y: 16} })
|
multiCaptureGame().makeMove({ player: 'white', pos: { x: 6, y: 16} })
|
||||||
.success.should.eql(true);
|
.success.should.eql(true);
|
||||||
done();
|
done();
|
||||||
})
|
})
|
||||||
|
|
||||||
it('multi stone group full group is in capturing', done => {
|
it('multi stone group full group is in capturing', done => {
|
||||||
const group = multiCaptureGame.boardState['5-16'].group;
|
const game = multiCaptureGame()
|
||||||
console.log(multiCaptureGame.groups[group].liberties)
|
const group = game.boardState['4-16'].group;
|
||||||
console.log(multiCaptureGame.boardState['4-16'].capturing)
|
game.boardState['6-16'].capturing[-1][0].should.eql(group);
|
||||||
multiCaptureGame.boardState['6-16'].capturing[-1][0].should.eql(group);
|
|
||||||
done();
|
done();
|
||||||
})
|
})
|
||||||
|
|
||||||
// it('multi stone group capture all points are 0', done => {
|
it('multi stone group capture all points are 0', done => {
|
||||||
// const boardState = multiCaptureGame.makeMove({ player: 'white', pos: { x: 6, y: 16} }).boardState;
|
const game = multiCaptureGame();
|
||||||
// boardState['5-16'].stone.should.eql(0)
|
game.makeMove({ player: 'white', pos: { x: 6, y: 16} });
|
||||||
// // boardState['4-16'].stone.should.eql(0)
|
game.boardState['5-16'].stone.should.eql(0)
|
||||||
// // boardState['4-17'].stone.should.eql(0)
|
game.boardState['4-16'].stone.should.eql(0)
|
||||||
// done();
|
game.boardState['4-17'].stone.should.eql(0)
|
||||||
// })
|
done();
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue