-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
54 lines (46 loc) · 1.01 KB
/
main.py
File metadata and controls
54 lines (46 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
from tkinter import *
import utils
import settings
from cellss import Cell
root=Tk()
#override the settings
root.configure(bg="black")
root.geometry('1440x720')
root.title('Minesweeper')
root.resizable(False, False)
top_frame=Frame(
root,
bg='black',
width=1440,
height=180
)
top_frame.place(x=0, y=0)
left_frame=Frame(
root,
bg='black',
width=utils.width_prct(25),
height=utils.height_prct(75),
)
left_frame.place(x=0, y=utils.height_prct(25))
center_frame=Frame(
root,
bg='black',
width=utils.width_prct(75),
height=utils.height_prct(75)
)
center_frame.place(x=utils.width_prct(25), y=utils.height_prct(25))
for x in range(settings.GRID_SIZE):
for y in range(settings.GRID_SIZE):
c= Cell(x,y)
c.create_btn_object(center_frame)
c.cell_btn_object.grid(
column=x,
row=y
)
Cell.create_cell_count_label(left_frame)
Cell.cell_count_label_object.place(
x=10, y=0
)
Cell.randomize_mines()
#window running
root.mainloop()