Skip to content
Snippets Groups Projects
Commit b84ecf13 authored by Garance Guey's avatar Garance Guey
Browse files

bug fix

parent 33ea2835
Branches
No related tags found
No related merge requests found
...@@ -188,12 +188,8 @@ def did_you_win (grid): ...@@ -188,12 +188,8 @@ def did_you_win (grid):
#Fonctinnalité 6 #Fonctinnalité 6
<<<<<<< HEAD
def list_moove_possible (grid):
#renvoie la liste des deplacements possibles
=======
def list_move_possible (grid): def list_move_possible (grid):
>>>>>>> c7f7a81e42fe1f954e38b492c9d251128aa9cf68 #renvoie la liste des deplacements possibles
list_bool=move_possible(grid) list_bool=move_possible(grid)
list_final=[] list_final=[]
if list_bool[0]: if list_bool[0]:
...@@ -216,27 +212,24 @@ def random_play(): ...@@ -216,27 +212,24 @@ def random_play():
#phase de jeu #phase de jeu
while not is_game_over(grid_game): while not is_game_over(grid_game):
<<<<<<< HEAD
#pour chaque tour #pour chaque tour
d=rd.choice(list_moove_possible(grid_game)) #on choisi un mouvement d=rd.choice(list_move_possible(grid_game)) #on choisi un mouvement
grid_game=move_grid(grid_game,d) #on le fait grid_game=move_grid(grid_game,d) #on le fait
grid_game=grid_add_new_tile(grid_game) #une tuile se crée grid_game=grid_add_new_tile(grid_game) #une tuile se crée
print(grid_to_string_with_size_and_theme(grid_game,THEMES["0"],4)) #on affuche le résulat print(grid_to_string_with_size_and_theme(grid_game,THEMES["0"],4)) #on affuche le résulat
print("\n***********************************\n") #permet aux différentes grilles d'être plus lisible print("\n***********************************\n") #permet aux différentes grilles d'être plus lisible
#vérification si le jeu est gagnant ou perdant #vérification si le jeu est gagnant ou perdant
=======
d=rd.choice(list_move_possible(grid_game)) d=rd.choice(list_move_possible(grid_game))
grid_game=move_grid(grid_game,d) grid_game=move_grid(grid_game,d)
grid_game=grid_add_new_tile(grid_game) grid_game=grid_add_new_tile(grid_game)
print(grid_to_string_with_size_and_theme(grid_game,THEMES["0"],4)) print(grid_to_string_with_size_and_theme(grid_game,THEMES["0"],4))
print("\n***********************************\n") print("\n***********************************\n")
>>>>>>> c7f7a81e42fe1f954e38b492c9d251128aa9cf68
if did_you_win(grid_game): if did_you_win(grid_game):
print("CONGRATS ! YOU WON !!!") print("CONGRATS ! YOU WON !!!")
else : else :
print ("YOU FAIL, TRY AGAIN") print ("YOU FAIL, TRY AGAIN")
return() return()
#TEST : random_play() random_play()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment