Hello!I want to print out a full minesweeper grid after the loss of the player in c but I can't get the random mines in the grid | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Hello!I want to print out a full minesweeper grid after the loss of the player in c but I can't get the random mines in the grid

This is what I've written: Thank u in advance. https://code.sololearn.com/ctmUg59xrZrp/?ref=app

28th Dec 2018, 5:06 PM
MargaritaK
5 Answers
0
Please paste your code in the Code Playground and share the link. It would make it easier for people to help you.
28th Dec 2018, 5:48 PM
Diego
Diego - avatar
0
So here you have 2 table, game_board for the reference where the mines is and board for player to play and look at, am i correct ? where o is open * is mine and nothing for unrevealed tiles. And now you want to print the entire board to reveal which tile are mines and which arent right ? Just print the game_board
28th Dec 2018, 6:14 PM
Taste
Taste - avatar
0
Taste thank you for answering. Yes that is right, I tried printing game_board but it doesn't print out both at once 'o' for unopened tiles or '*' for mines and I'm not sure what I'm doing wrong.
28th Dec 2018, 6:17 PM
MargaritaK
0
You really need to work on structuring your code, its kinda hard to read. Btw. If the board are used as reference where the mines is, you can first populate them with open tiles before replacing some with mines. This way you can print the board you're using as reference in the same way as you print the game_board
28th Dec 2018, 6:33 PM
Taste
Taste - avatar
0
Taste thank you very much!
28th Dec 2018, 6:38 PM
MargaritaK