Re:Advanced Minesweeper
by thesteamboat on Monday June 04, 2012 @05:21PM
(#4066036)
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.
Re:Advanced Minesweeper
by randomdrake on Monday June 04, 2012 @03:55PM
(#4065639)
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.
Re:Advanced Minesweeper
by archangel_one on Monday June 04, 2012 @05:27PM
(#4066059)
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.
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...