Skip to content

Commit 670d7c7

Browse files
committed
v0.1.4 graphical update, number tiles are now loaded in a list
1 parent f8980c8 commit 670d7c7

17 files changed

+8
-3
lines changed

images/original/tile_1.png

-14 Bytes
Loading

images/original/tile_2.png

-17 Bytes
Loading

images/original/tile_3.png

-13 Bytes
Loading

images/original/tile_4.png

-14 Bytes
Loading

images/original/tile_5.png

-8 Bytes
Loading

images/original/tile_6.png

-13 Bytes
Loading

images/original/tile_7.png

-13 Bytes
Loading

images/original/tile_8.png

-14 Bytes
Loading

images/tile_1.gif

851 Bytes
Loading

images/tile_2.gif

854 Bytes
Loading

images/tile_3.gif

855 Bytes
Loading

images/tile_4.gif

856 Bytes
Loading

images/tile_5.gif

853 Bytes
Loading

images/tile_6.gif

857 Bytes
Loading

images/tile_7.gif

851 Bytes
Loading

images/tile_8.gif

857 Bytes
Loading

minesweeper.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,15 @@ def __init__(self, master):
1616
self.tile_mine = PhotoImage(file = "images/tile_mine.gif")
1717
self.tile_flag = PhotoImage(file = "images/tile_flag.gif")
1818
self.tile_wrong = PhotoImage(file = "images/tile_wrong.gif")
19+
self.tile_no = []
20+
for x in range(1, 9):
21+
self.tile_no.append(PhotoImage(file = "images/tile_"+str(x)+".gif"))
1922

2023
# set up frame
2124
frame = Frame(master)
2225
frame.pack()
2326

27+
# show "Minesweeper" at the top
2428
self.label1 = Label(frame, text="Minesweeper")
2529
self.label1.grid(row = 0, column = 0, columnspan = 10)
2630

@@ -98,10 +102,11 @@ def gameover(self):
98102

99103
### END OF CLASSES ###
100104

105+
# create Tk widget
101106
root = Tk()
102-
107+
# set program title
103108
root.title("Minesweeper")
104-
109+
# create game instance
105110
minesweeper = Minesweeper(root)
106-
111+
# run event loop
107112
root.mainloop()

0 commit comments

Comments
 (0)