write a programme for minesweeper game using GUI

Anonymous
timer Asked: Nov 8th, 2016

Question description

to write a programme for minesweeper game 

Minesweeper Minesweeper is a single-player puzzle 2D game that consists of a matrix of rectangular areas. To win the game, the player should clear a rectangular board containing hidden "mines" without detonating any of them, with help from clues about the number of neighboring mines in each field. If the player suspects the existence of a mine at a specific rectangle, it can be flagged. For this assignment you need to implement the Minesweeper in Python with a GUI using tkinter under the following guidelines: 1. 2. 3. 4. 5. The game design should be object-oriented (use classes to represent objects) The main board should be a 9 x 9 rectangular locations containing 10 mines. Each location can be implemented as a Button object from the tkinter class. The mines should be distributed randomly on the board. There should be a button with an image in the top of the game to create a new game and also to indicate the game status. o If the game is still in progress, then it should be o If the player lost the game by clicking a mine, then and the game is over. o If the player won the game by clicking all buttons except for mines, then 6. When the player left-clicks on a button, you have three cases: o The location is mine, then it will show all the other mines and end the game o The location is not a mine with no neighboring mines, then remove the button and display any neighboring empty locations as well until you show a location that is a mine-neighbor o The location is not a mine with at least one neighboring mine, then display a number declaring how many neighboring mines are around the current location. 7. When the player right-clicks on a button, then flag the button by displaying the flag image 8. Assume that all images will be at “C:\\temp\\” 9. Only submit one file Minesweeper.py Hint: To add an image to a button, use the PhotoImage object. For example: self.photo_new = PhotoImage(file="c:\\temp\\new_game_button.png") self.game_button = Button(image=self.photo_new)

Tutor Answer

(Top Tutor) Studypool Tutor
School: Purdue University
Studypool has helped 1,244,100 students
flag Report DMCA
Similar Questions
Hot Questions
Related Tags
Study Guides

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors