Skip to content
Snippets Groups Projects
Commit 8b34e540 authored by Thomas Bianco's avatar Thomas Bianco
Browse files

test git

parent e150ad45
No related branches found
No related tags found
No related merge requests found
{
"test_grid_2048.py::test_grid_to_string": true,
"test_grid_2048.py::test_move_row_right": true
"test_grid_2048.py::test_move_possible": true
}
\ No newline at end of file
[
"test_grid_2048.py::test_move_row_left"
"test_grid_2048.py::test_create_grid",
"test_grid_2048.py::test_get_value_new_tile",
"test_grid_2048.py::test_get_all_tiles",
"test_grid_2048.py::test_get_empty_tiles_positions",
"test_grid_2048.py::test_get_new_position",
"test_grid_2048.py::test_grid_add_new_tile",
"test_grid_2048.py::test_init_game",
"test_grid_2048.py::test_long_value_with_theme",
"test_grid_2048.py::test_move_row_left",
"test_grid_2048.py::test_move_row_right",
"test_grid_2048.py::test_is_grid_full",
"test_grid_2048.py::test_move_possible"
]
\ No newline at end of file
......@@ -121,3 +121,12 @@ def move_row_right(row):
def is_grid_full(grid):
return get_empty_tiles_positions(grid) == []
def move_possible(grid):
possibles = []
for d in ["left","right","up","down"]:
possibles.append(move_gride(grid,d) != grid)
return possibles
def is_game_over(grid):
......@@ -87,3 +87,7 @@ def test_move_row_right():
def test_is_grid_full():
assert is_grid_full([[0, 16, 32, 0], [64, 0, 32, 2], [2, 2, 8, 4], [512, 8, 16, 0]]) == False
assert is_grid_full([[4, 16, 32, 4], [64, 8, 32, 2], [2, 2, 8, 4], [512, 8, 16, 1024]]) == True
def test_move_possible():
assert move_possible([[2, 2, 2, 2], [4, 8, 8, 16], [0, 8, 0, 4], [4, 8, 16,32]]) == [True,True,True,True]
assert move_possible([[2, 4, 8, 16], [16, 8, 4, 2], [2, 4, 8, 16], [16, 8, 4,2]]) == [False,False,False,False]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment