Review my code please :D

I'm quite new to c++ and made a minesweeper game with ascii symbols. I would like to see what experienced think of my coding style - could it have been more efficient? Is it difficult to read or follow? How can I improve in the future? And most importantly, how should I change my habits while I'm actually coding?

Here are the 3 files:
Main.cpp: http://pastebin.com/nsRPrJ8T
Minesweeper.cpp: http://pastebin.com/GGGS85bL
Minesweeper.h: http://pastebin.com/ba7e6xKn

Thanks for the feedback gusy :D
~DoobDood
Two things:

1. Avoid magic numbers:

Instead of e.g.

case 0: //this means it's not revealed yet

Use enum

1
2
3
enum { NotRevealed = 0, ... };

case NotRevealed: //this means it's not revealed yet 


2. Debugger friendly

Instead of e.g.

if(board[boardY][boardX][0] == 0) board[boardY][boardX][0] = 9;

Each expression on its own line (for breakpoint)

1
2
3
4
enum { ..., Mine = 9, ... };

if(board[boardY][boardX][0] == 0) // What is the meaning of 0?
  board[boardY][boardX][0] = Mine;

Topic archived. No new replies allowed.