![]() This number includes bombs touching the tile in cardinal directions, as well as diagonal directions. If a number is shown, that number is an indicator of how many bombs the tile is touching. If a bomb is shown, the user loses the game and must restart. Once clicked, the tile will reveal the number or bomb hiding behind it. Once the difficulty is chosen, a board of the desired size is randomly generated containing a grid of gray tiles, with each tile hiding either a number or a bomb behind it. The difficulty chosen will affect the size of the playing board, as well as the number of bombs, or mines, on the board. In Minesweeper, the user is typically given the option to choose a difficulty. Minesweeper is a popular classic game that comes installed on most computers, otherwise, the game can easily be found online. This way it eliminates the need for hard coding edges and corners because it would exceed matrix dimensions.The second game developed by our software development team, Grayson Hollaway, Tej P atel, Ojas Deshpande, and Spencer Finck, was Minesweeper. I was thinking of surrounding the matrix with zeroes and then programming it in a way where it adds up all the surrounding ones. The output would be ġ,2,4 etc means that there are 1, 2 or 4 mines around that square.ĭo i have to hard code every possibility or do I use if or while loops? Or does anybody have a different approach to this? The output is another matrix telling where the mines are and the proximity of each mine.įor example: if i had the input matrix ![]() The input is a matrix filled with zeroes and 1's, ones being the mines and zeroes being nothing. I am learning basic matlab and one of the assignment is to create a minesweeper function.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |