Minesweeper

my code is not working correctly and i need help writing int main. Any help is appreciated.

Last edited on
Please use code tags to make your code easy to read.
Line 34,35,37,38: Why are you taking % 12? You're board is only 8x8. This is going to cause out of bounds references.

Line 85: Missing //

Line 93,94,100,115,116: rows, cols undefined.

Line 95: Should be:
 
 if (board[r][c].is_bomb)


Line 99: You're missing an opening {

Line 102: board[newRow][newCol] is a GridElement. You cant compare a GridElement to a character literal.

Line 106: This line makes no sense.
 
board[r][c] = (char '*';)('0' + count_bomb_neighers);


Line 28,133: srand() should be called only once. Preferably at the beginning of main().

Line 115,117: user_num1 and user_num2 are undefined.

PLEASE USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post.
http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.




Last edited on
Topic archived. No new replies allowed.