Question: Matlab Problem Problem 5 MineSweeper is a classic Microsoft Windows game. Many of you may have played it, but in case you haven't yet try

 Matlab Problem Problem 5 MineSweeper is a classic Microsoft Windows game.

Matlab Problem

Problem 5 MineSweeper is a classic Microsoft Windows game. Many of you may have played it, but in case you haven't yet try it out here. A map of Mine Sweeper is a N-by-M grid. Each block in a map is either a mine or a number. If a block is a number, it denotes the number of mines in its eight adjacent blocks. A sample map of MineSweeper is shown below: ONN NNW NP MAN W WIN 1 1 11 1 1 Note that the empty blocks are those with number 0. Let the user enter a matrix whose non-zero elements represent mines. For example, the above game instance corresponds to an input matrix of TO 1 1010001 01 000110 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 Based on the input matrix, produce the MineSweeper map. Use * to represent the mine blocks and numbers for others. In the above example, the MineSweeper map is 2 * * 2 3 2 1 2 * 3 2 2 1 1 1 0 1 2 3 1 1 0 0 0 011 100 0 0 0 0 1 1 0 0 10 0 0 0 1 2 * 10 0 0 0 1 * 2 1 0 * * 2 1 1 Hint: 2 MSE 280 Problem Set 3 Fall 2020 You will need to take into account the "edge effect" when evaluating the number in each block. A useful MATLAB function for this problem would be num2str(number). This function converts a number to an character array (a string)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!