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

début objectif Z

parent be048afb
No related branches found
No related tags found
No related merge requests found
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
<option value="E501" /> <option value="E501" />
<option value="W29" /> <option value="W29" />
<option value="E501" /> <option value="E501" />
<option value="W29" />
<option value="E501" />
</list> </list>
</option> </option>
</inspection_tool> </inspection_tool>
......
No preview for this file type
File added
import tkinter as tk import tkinter as tk
from run_2048 import *
TILES_BG_COLOR = {0: "#9e948a", 2: "#eee4da", 4: "#ede0c8", 8: "#f1b078", \
16: "#eb8c52", 32: "#f67c5f", 64: "#f65e3b", \
128: "#edcf72", 256: "#edcc61", 512: "#edc850", \
1024: "#edc53f", 2048: "#edc22e", 4096: "#5eda92", \
8192: "#24ba63"}
TILES_FG_COLOR = {0: "#776e65", 2: "#776e65", 4: "#776e65", 8: "#f9f6f2", \
16: "#f9f6f2", 32: "#f9f6f2", 64: "#f9f6f2", 128: "#f9f6f2", \
256: "#f9f6f2", 512: "#f9f6f2", 1024: "#f9f6f2", \
2048: "#f9f6f2", 4096: "#f9f6f2", 8192: "#f9f6f2"}
TILES_FONT = {"Verdana", 40, "bold"}
def graphical_grid_init(): def graphical_grid_init():
root = tk.Tk() root = tk.Tk()
window = tk.Toplevel() window = tk.Toplevel()
window.grid()
grid_game = init_game()
grid_size = 4
background = tk.Frame(root)
graphical_grid = []
for i in range(grid_size):
graphical_grid.append([])
for j in range(grid_size):
graphical_grid[i].append(tk.Frame(master = background, bd = 2,relief = "raised", bg = TILES_BG_COLOR[0],height = 100, width = 100))
graphical_grid[i][j].grid(column = i, row = j)
background.pack()
root.mainloop() root.mainloop()
graphical_grid_init() graphical_grid_init()
...@@ -204,7 +204,6 @@ def list_move_possible (grid): ...@@ -204,7 +204,6 @@ def list_move_possible (grid):
return(list_final) return(list_final)
<<<<<<< HEAD
def random_play(): def random_play():
#on suppose que le jeu par defaut comprend une grille de 4x4 #on suppose que le jeu par defaut comprend une grille de 4x4
...@@ -228,7 +227,3 @@ def random_play(): ...@@ -228,7 +227,3 @@ def random_play():
else : else :
print ("YOU FAIL, TRY AGAIN") print ("YOU FAIL, TRY AGAIN")
return() return()
#TEST random_play()
=======
>>>>>>> 15883ac11a1d5e067e173c9ddba3c0e80ca1d0df
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment