コード例 #1
0
ファイル: test_puzzle.py プロジェクト: fhennig/15_puzzle
 def test_reverse_action(self):
     self.assertEqual(p.reverse_action((1, 0)), (-1, 0))
     self.assertEqual(p.reverse_action((-1, 1)), (1, -1))
     self.assertEqual(p.reverse_action((-1, 1, 0)), (1, -1, 0))
コード例 #2
0
ファイル: solvers.py プロジェクト: fhennig/15_puzzle
 def useful_actions(self):
     actions = puzzle.possible_actions(self.p)
     if len(self.hist) > 0:
          actions.remove(puzzle.reverse_action(self.hist[-1]))
     return actions