Skip to content

Latest commit

 

History

History
32 lines (20 loc) · 709 Bytes

minesweeper.md

File metadata and controls

32 lines (20 loc) · 709 Bytes

Back

Minesweeper

https://app.codesignal.com/arcade/intro/level-5/ZMR5n7vJbexnLrgaM

Challenge description

In the popular Minesweeper game you have a board with some mines and those cells that don't contain a mine have a number in it that indicates the total number of mines in the neighboring cells. Starting off with some arrangement of mines we want to create a Minesweeper game setup.

Example

For

matrix = [[true, false, false],
          [false, true, false],
          [false, false, false]]

the output should be

solution(matrix) = [[1, 2, 1],
                    [2, 1, 1],
                    [1, 1, 1]]

Solution

Solved with Rust