- Tech Corner
- Tools + Games
- Minesweeper
Java Minesweeper
A minesweeper game written in Java Swing.
Overview
This is a rewrite of the Windows minesweeper game. The goal of the game is to locate all the mines as quickly as possible without uncovering any of them. If a mine is uncovered, the game is lost.
Game Rules
- Set a new game by clicking on Game > New, or on the happy face button.
- The timer is started when the user first clicks on any square in the minefield, and is stopped when the game is over.
- The game is over when a mine is uncovered (game lost) or when all non-mine squares are uncovered (game won).
- Left-click on a square to uncover it.
- The number on an uncovered square indicates the number of mines in the eight (8) squares surrounding it.
- Right-click on a square to mark it as containing a mine.
- Middle-click (3-button mouse) or simultaneously left and right click (2-button mouse) on a square shows the eight (8) squares surrounding it. If the square is already uncovered and the number of flags around it equals to its number, then the surrounding covered and unmarked squares are uncovered.
About the Game
I know someone who could not finish the expert level of the Windows minesweeper game (back in 2005, he has since then "conquered" the game). Then at some time, I got bored and decided to write the game in Java on my spare time, so that I have something interesting to do. It turned out that I can also use it as an excuse to tease the aforementioned person: the game cannot be that complicated if I can write it!
In other words, this game is born from funny events in my life. It also happens to be a good example of the MVC design pattern.
Copyright © 2005-2006, Northwest Summit. All rights reserved.