Skip to content

Comment on Advanced Minesweeper

Comments

Although I have no idea since I have never seen the code, I'm pretty sure there's no way to hit a bomb on your first click. I'm played enough (MS Windows) Minesweeper and have never, ever hit a bomb on the first click.

As a side note, Minesweeper the first game I ever programmed was for my intro C class in college using SRGP[1] as the graphics library. Thinking back, it was a tough project. The Minesweeper logic wasn't so bad but doing the graphics was the most work. In hindsight, it shouldn't have taken more than a couple hours to code but took everyone a fair amount of time. Of course we didn't know what they hell we were doing. Fun stuff.

EDIT: After searching around it appears there is code to prevent the first-click bomb in a rather novel way[2].

[1] http://www.niksula.cs.hut.fi/~tik86120/X_srgp.html [2] http://www.sanchitkarve.com/blog/2009/01/does-minesweeper-ch...

Microsoft uses a bad algorithm. The clever algorithm to prevent dying on the first click: Generate one extra mine during the random generation phase. After the first click, remove any mine the player clicks on, or, if they click on none, remove one randomly.

As far as I can recall, hitting a bomb on the first click is possible. But, if the source code proves my memory wrong, it certainly wouldn't be the first time.

I wonder if this is an enhancement in Vista Minesweeper? I'm almost certain that it used to be possible to land on a mine with your first click in older versions.

Yes.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.