
clears the neighbours, if they don't have mines clears a field and it's neighbours, if they don't have mines Procedure Mark (Item : in out Grid X, Y : in Positive ) is counts how many mines are in the surrounding fieldsįunction Mines_Nearby (Item : Grid X, Y : Positive ) return Natural is Type Grid is array (Positive range, Positive range ) of Field Note: Changes may be made to the method of clearing mines to more closely follow a particular implementation of the game so long as such differences and the implementation that they more accurately follow are described.Īda with Ada. You may also omit all GUI parts of the task and work using text input and output. The Task is to create a program that allows you to play minesweeper on a 6 by 4 grid, and that assumes all user input is formatted correctly and so checking inputs for correct form may be omitted. You win when you have correctly identified all mines.Of course you lose if you try to clear space that has a hidden mine.Other free points show as an integer count of the number of adjacent true mines in its immediate neighborhood, or as a single space ' ' if the free point is not adjacent to any true mines.If the point is free space then it is cleared, as are any adjacent points that are also free space- this is repeated recursively for subsequent adjacent free points unless that point is marked as a mine or is a mine.You can mark what you think is free space by entering its coordinates.You may mark what you think is the position of a mine which will show as a '?'.



You are encouraged to solve this task according to the task description, using any language you may know.
