Skip to content

Latest commit

 

History

History
17 lines (16 loc) · 715 Bytes

README.md

File metadata and controls

17 lines (16 loc) · 715 Bytes

Minesweeper1

#Define a function called mines which is similar to minesweeper chessboard game #The code will get the number of rows and columns as arguments when the function is called #The code will return the number of mines available around the "." in all directions : Horizantally, vertically and diagonal #For example you choose the number of rows 4 and the number of columns 5 and you fill the board as below #Note you should fill the board either with '*' which is the mine or a dot '.' #The original matrix you filled is

[. * . * *]

[* . . * .]

[* * . * *]

[. . * . .]

#The result matrix will be

[[2, '', 3, '', '*']

['', 4, 5, '', 5]

['', '', 4, '', '']

['.', 3, '*', 3, '.']]