![]() As you work through the following steps, make sure that your program runs correctly before going to the next step. Work through the minesweeper codingbat problem set.Suggested steps to completing this assignment: Your game should use Math.random() to randomly place the mines.The game should end when all the buttons that contain mines have been correctly marked and all other buttons have been clicked (assuming that you have not been blown up by then!).Your program should then recursively keep pressing those neighboring buttons that are not next to a mine. If the user clicks on a button and no number appears, then there are no mines neighboring that button.For example, a corner button has only three neighbors. Note that the buttons on the edges have fewer than 8 neighbors. Recall that each position has at most 8 neighbors. If the user clicks on a button that does not contain a mine, a number appears at that location indicating the number of neighbors that DO contain mines.If the user clicks on a button that contains a mine, the game ends and all the mines are displayed.Make sure all class member variables and methods are labeled appropriately as either public or private.Your minesweeper game will be a two dimensional array of buttons.Type Guido in the search box, the click on Guido by Florian Jenett and then click Install. To install it, start Processing and choose Sketch | Import Library | Add Library. We'll be using a GUI library called Guido. You may find slides 71-106 of the 2d Arrays slide presentation and codingbat minesweeper problems helpful. You can also try my slightly easier Minesweeper game. ![]() If you are not familiar with minesweeper you should play the game until you are. In this assignment you will be recreating the Microsoft Minesweeper game.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |