Forum Archive

Sharing my minesweeper implementation

maus80

Hi Guys,

I've finished my minesweeper game. Check the blog out at:

http://www.leaseweblabs.com/2014/05/minesweeper-game-ios-python-pythonista/

Or just skip to the code:

https://github.com/mevdschee/pythonista-minesweeper/blob/master/Mines.py

Let me know what you think!

omz

This brings back memories... Very nice implementation, thanks for sharing!

bee18

Thank you for sharing your code. It's pretty neat. Really remind me of Windows. (FYI, I no longer use Windows since 2008). :)

Just one tiny little bit of annoyance… the real windows' minesweeper never give a bomb at the first try. Never. ;)

And also a double click (tap) would automatically reveal the already obvious blocks. This really helps reducing time in order to get fastest time record. Btw, my fastest record is 3 seconds on a small grid (10 bombs). :)

Sebastian

Nice! Thanks for sharing! :)
I really like how you used base64 for the images!

bee18

@maus80:

I just forked your minesweeper gists into:

https://github.com/git-bee/pythonista-minesweeper

Or, here the pastebin version:

http://pastebin.com/NMvT0kvi

Enhancements:

  • bigger grid by default
  • support landscape orientation
  • no bomb at the first try :)
  • tap-and-hold on open tile to auto-reveal
  • game timer starts on first tap on tile, instead of on first tap on the smiley button
  • some minor informational text (and a title)
  • some minor better variable naming (IMHO)

I wrote this on my iPod touch, so my modification might doesn't work correctly on iPad due the different display aspect ratio. You could simply adjust the value in the source code.

Have fun! :)

bee18

Ok... I don't understand why the list is NOT displayed correctly in this forum. :(

ccc

Try a blank line before the list and/or try indenting the list item lines.

bee18

Aha... Thank you @ccc. :)