Beispiel #1
0
 def test_move_right_when_has_merge_but_not_together_then_merged(self):
     g = TwoThousandFortyEight(
         board=[[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [4, 0, 4, 0]])
     self.assertEqual(
         [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 8]],
         g.move_right())
Beispiel #2
0
 def test_move_right_when_has_one_value_and_not_possible_then_error_raised(
         self):
     g = TwoThousandFortyEight(
         board=[[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 2]])
     with self.assertRaises(ValueError):
         g.move_right()
Beispiel #3
0
 def test_move_down_when_bottom_row_populated_and_merges_possible_then_error_raised(
         self):
     g = TwoThousandFortyEight(
         board=[[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [4, 8, 4, 2]])
     with self.assertRaises(ValueError):
         g.move_right()