News for hackers. Stuff that matters.
Re:One Square Minesweeper by lelanthran on Wednesday October 23, 2024 @08:24AM (#41924278)
What a convoluted solution.

I always assumed it did things the way I did when I wrote my minesweeper game: it only generated the mines on the first click, avoiding the clicked tile.

I wonder why they did it that way?

Re:One Square Minesweeper by SAI_Peregrinus on Wednesday October 23, 2024 @12:14PM (#41926491)
Probably performance. It's an old game, it seems faster if the mines can get generated before the user first clicks, and then move the mine if their first click was on a mine. If you wait for them to click to generate then the entire generation step has to run before the user notices.
Re:One Square Minesweeper by Shadowed_ on Wednesday October 23, 2024 @08:52AM (#41924561)
I don't know for sure, but they probably didn't plant it at first and later it was simpler to move mine elsewhere than to change the way mines are generated.