Minesweeper

I wrote this simple Minesweeper game when offering the challenge to a friend who was trying to get back into programming. It turned out to be a fun little project so I figured I’d share the code here for those who are interested.

Minewsweeper

The game itself is made up of a board which contains cells/points. According to the game rules, cells (which may or may not contain mines) may be clicked or flagged. The objective is to flag all the cells containing mines and to click all of the “safe” cells. Once all of the safe cells are checked and all of the cells with mines are flagged, the game is won. If a cell with a mine is clicked, the game is lost.

I kept the game engine (msw.game.Engine) separate from the GUI, so the engine itself can be reused and plugged into any GUI aside from the one I included in the project. The main class is msw.game.Main. If you find any bugs or see any room for improvement, please feel free to share. (One feature I didn’t yet add was a timer and proper handling when the game finishes [e.g. high scores]).

This entry was posted in Projects and tagged . Bookmark the permalink. Follow any comments here with the RSS feed for this post. Post a comment or leave a trackback: Trackback URL.

2 Comments

  1. Chris
    Posted January 5, 2011 at 5:23 pm | Permalink

    The GUI version is much nicer than where I left mine at.. lol

    • Posted January 5, 2011 at 5:44 pm | Permalink

      You should finish it.. or extend my game by completing the timer and game over / high scores…

One Trackback

  1. By Kurtis Chiappone | Klondike on December 30, 2010 at 9:52 pm

    [...] Contact « Minewsweeper [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>