Пример #1
0
 def test_2normalize(self):
     logger.info("test_2normalize")
     rows = [1, 0, 3, 2, 1]
     gs = GameState(rows)
     self.assertEqual(gs.get_rows(), rows)
     self.assertEqual(str(gs), "[10321]")
     self.assertFalse(gs.is_normalized())
     p = gs.normalize()
     self.assertTrue(gs.is_normalized())
     self.assertEqual(gs.get_rows(), [0, 1, 1, 2, 3])
     gs.denormalize(p)
     self.assertEqual(gs.get_rows(), rows)
Пример #2
0
 def __init__(self, game_state: GameState):
     assert game_state.is_normalized()
     self.game_state: GameState = game_state
     self.winning: int = 0
     self.children: List[GameNode] = []