コード例 #1
0
 def test_four_corners(self):
     corners = Board(Game()).corners()
     self.assertEqual(len(corners), 4)
コード例 #2
0
 def test_nine_board_positions_by_default(self):
     game = Game()
     board = Board(game)
     self.assertEqual(len(board.positions()), 9)
コード例 #3
0
 def test_board_positions_are_lists(self):
     # they're not tuples because I have a dream of sending game states
     # back and forth as JSON
     positions = Board(Game()).positions()
     for position in positions:
         self.assertIsInstance(position, list)
コード例 #4
0
 def setUp(self):
   self.game = Game()
   self.subject = ThroughLine(self.game)
   self.board_size = Board(self.game).get_size()
コード例 #5
0
 def setUp(self):
     self.b = Board()
コード例 #6
0
def calculate_board_state_label(num: str) -> Board:
    _board_state = bin(num)[2:].zfill(18)
    return Board(_board_state)
コード例 #7
0
 def test_position_not_occupied_before_moving(self):
     game = Game()
     moves = Moves(game)
     board = Board(game)
     for position in board.positions():
         assert not moves.is_occupied(position)