The following is useful as part of a program to play Minesweeper

The following is useful as part of a program to play Minesweeper. Suppose you have a 5×5 list that consists of 0s and M’s. Write a program that creates a new 5×5 list that has M’s in the same place, but the Zeroes are replaced by counts of how many M’s are in adjacent cells (adjacent either horizontally, vertically, or diagonally). An example is shown below. An example is shown below: Transcribed Image Text: [[0, ‘M’
[[0, “м’, о, “м’, ој,
[0, о, “м’, о, ој,
[0, о, о, о, 0ј,
[“M”, “М’, о, о, ој,
0, 0],
0, 0],
‘M’, 0]]
‘M’, 0,
[0, о, о,
[[1, ‘M’
[[1, “M’, 3, “М’, 1],
[1, 2, “М”, 2, 1],
[2, 3, 2, 1, 0],
2, 1, 1],
[‘M’,
“М’, 2, 1, 1],
[2, 2, 2, ‘м”, 1]]

-25-


Buy plagiarism free, original and professional custom paper online now at a cheaper price. Submit your order proudly with us



Essay Hope