Minesweeper logic & int board ???

I am trying to make a minesweeper game, and I need the console to hide all the cells, I think I need a logic board and an int board but unsure how to implement this, can anyone help, please?

https://pastebin.com/fJ9bemGD
many of us can't access external links.

the same idea applies as the idea for generating the random mines.
you have a map of the entire board of what the player has seen, and what they have not.

you can tie the two together. If this is going to grow, you may want your map to become a struct or something. So far it is doable in a single character. For example say : 0 is no mine, unseen. 1 is mine, unseen. 2 is no mine, seen, 3 is mine, seen. (this is binary 00, 01, 10, 11) but you don't have to do it bitwise. You can do it in a case statement off 0,1,2,3 or if statements etc, whatever format you like best.

So now the bool board ... becomes char board[] [] and you still set them all to zero to start, then assign some of them 1s (your random mines) then as the user plays, you will use logic to set some to 2s and 3s.
Topic archived. No new replies allowed.