from Hacker News

Show HN: Minesweeper

by madprops on 2/22/21, 11:58 AM with 2 comments

  • by mtmail on 2/22/21, 12:39 PM

    Very nice readable source code.

    One feature request I'd have is allowing users to skip flags. I usually play minesweeper fast and don't set any flags. The game should end when I opened all fields without hitting a bomb, at least that's how others minesweeper implementations work (e.g. https://www.google.com/fbx?fbx=minesweeper). Maybe

    if (num_revealed = x*y-num_bombs) Mine.over = true

    The google one also seems to guarantee that the first click opens a whole field, never just one number or bomb. Not sure how they do that but it make the game more enjoyable.