Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void MinesweeperBoard::revealField(int x, int y)
- {
- if(x>=0 || x<=width)
- {
- if(y>=0 || y<=height)
- {
- if(board[y][x].isRevealed==false)
- {
- if(getGameState()!=FINISHED_LOSS && getGameState()!=FINISHED_WIN)
- {
- if(board[y][x].hasFlag==false)
- {
- if(board[y][x].hasMine==false)
- {
- board[y][x].isRevealed=true;
- return;
- }
- if(board[y][x].hasMine==true && player_moves==0 && mode!= DEBUG)
- {
- board[std::rand()%height][std::rand()%width].hasMine=true;
- board[y][x].isRevealed=true;
- return;
- }
- if(board[y][x].hasMine==true)
- state=FINISHED_LOSS;
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement