Ejemplo n.º 1
0
 def from_config(config_path: str) -> 'Game':
     config = read_config(config_path)
     win_length, block_size, board_size, num_players = \
         config['game']['win_length'], \
         config['game']['block_size'], \
         config['game']['board_size'], \
         config['game']['players']
     board = Board.blank(board_size, block_size)
     return Game(board, win_length, 0, 0, num_players, Position(0, 0))
Ejemplo n.º 2
0
 def test_get_size(self):
     self.assertEqual(self.test_board.get_size(), 2)
     for i in range(1, 10):
         self.assertEqual(Board.blank(i, 3).get_size(), i)
Ejemplo n.º 3
0
 def test_get_block_size(self):
     self.assertEqual(self.test_board.get_block_size(), 3)
     for i in range(1, 10):
         self.assertEqual(Board.blank(2, i).get_block_size(), i)