exercism-c/minesweeper
Blizzard Finnegan b92478b09c
Init commit
Leap, Difference of Squares, Grains, Collatz Conjecture, Queen Attack,
Darts, Hamming, and Space Age completed yesterday.

Binary and Linked List completed today.
2025-01-11 18:45:47 -05:00
..
.exercism Init commit 2025-01-11 18:45:47 -05:00
test-framework Init commit 2025-01-11 18:45:47 -05:00
HELP.md Init commit 2025-01-11 18:45:47 -05:00
makefile Init commit 2025-01-11 18:45:47 -05:00
minesweeper.c Init commit 2025-01-11 18:45:47 -05:00
minesweeper.h Init commit 2025-01-11 18:45:47 -05:00
README.md Init commit 2025-01-11 18:45:47 -05:00
test_minesweeper.c Init commit 2025-01-11 18:45:47 -05:00

Minesweeper

Welcome to Minesweeper on Exercism's C Track. If you need help running the tests or submitting your code, check out HELP.md.

Instructions

Add the mine counts to a completed Minesweeper board.

Minesweeper is a popular game where the user has to find the mines using numeric hints that indicate how many mines are directly adjacent (horizontally, vertically, diagonally) to a square.

In this exercise you have to create some code that counts the number of mines adjacent to a given empty square and replaces that square with the count.

The board is a rectangle composed of blank space (' ') characters. A mine is represented by an asterisk ('*') character.

If a given space has no adjacent mines at all, leave that square blank.

Examples

For example you may receive a 5 x 4 board like this (empty spaces are represented here with the '·' character for display on screen):

·*·*·
··*··
··*··
·····

And your code will transform it into this:

1*3*1
13*31
·2*2·
·111·

Source

Created by

  • @vlzware

Contributed to by

  • @h-3-0
  • @patricksjackson
  • @QLaille
  • @ryanplusplus
  • @wolf99