ECI interview question

Design the logic for minesweeper