def test_move_left(self):
     config = Configuration().create(["0 0 0 0 0 0", "1 0 0 1 0 0", "1 0 0 0 0 0"])
     display = BoardDisplay(None, config)
     completion = MoveCompletion(config)
     old_points = [Point(1, 3)]
     new_points = completion.move(LEFT, old_points)
     completion.move_tiles(old_points, new_points, T_TILE)
     self.assertEqual([Point(1, 2)], new_points)
     self.assertEqual("0 0 0 0 0 0 \n" + "1 0 1 0 0 0 \n" + "1 0 0 0 0 0 \n", display.get_pieces_string())
Beispiel #2
0
 def _do_first_move(self):
     completion = MoveCompletion(self.pieces)
     if completion.is_valid_first_move(self.cur_shape.get_points()):
         self._move_tiles([], self.cur_shape.get_points())
     else:
         self.game_over = True