Closed sphaso closed 11 years ago
The issue is not that they change sides, it is what your board reference points to.
Here is the code from the init method:
self.game = simple_go.Game(self.size)
self.board = simple_go.Board(self.size)
You have two different objects you are dealing with. When you make a move in Game object it does this:
I edited your code in test_firstMove to test the board returned by the Game.make_move operation:
def test_firstMove(self):
pos = (3, 3)
board = self.game.make_move(pos)
self.assertEqual(self.game.current_board.goban[pos], simple_go.BLACK)
# TOTHINK: side doesn't change until the next move? this fails'
self.assertEqual(board.side, simple_go.WHITE)
test_firstMove plays a move on an empty board then asserts that side is WHITE. This test fails because (I guess) the side changes at the beginning of each move not at the end. Is this something we want? are other functions dependant on this behaviour?