Minesweeper Applet



Play Free Online Minesweeper Game here, all day all night

MineSweeper was/is, in the author's intentions (that would be me), a Java standalone application, from which the applet you see was obtained by removing all that functionality that did not comply to the applet security restrictions. I built this Minesweeper applet from scratch during uni summer holidays in 2000 to play with Java & AWT (Java Swing was not a package installed by default in web browsers). That means that all the buttons, user interface, game logic and everything is coded into the applet.

Play the classic game in Beginner, Intermediate, and professional modes. It's the perfect way to play on a Mac!

Minesweeper Rules

Minesweeper: Rules and Basics

At first glance, Minesweeper is a simple game of thought and logic. The goal: The player has to uncover the empty fields and avoid those fields behind which mines are hidden.

The field

With Minesweeper you can choose between three standard playing fields with different levels of difficulty.

  • Beginners: 81 fields, 10 mines or 35 mines
  • Advanced: 256 fields, 40 mines or 99 mines
  • Professionals: 480 fields, 99 mines or 170 mines
  • You can also create a custom playing field with a custom number of mines.

Playstyle

The Minesweeper rules are simple:

  • The game is normally finished when a mine is uncovered. In contrast to the Windows Minesweeper, you can continue playing by taking back a turn. The uncovered mines are displayed in a counting field.
  • The game continues when you uncover an empty square.
  • If a number is displayed when a square is uncovered, this number represents the number of mines hidden in the adjacent 8 squares. This information can be used to determine under which of the adjacent fields there are mines and which fields can be clicked safely.
Hints and tipsMark the mines. If you assume that a mine is hidden behind a field, right-click on it. This marks the field. You can deselect the field by right-clicking on it again.Study the patterns. If the numbers 2-3-2 are displayed in three consecutive fields, then there are probably three mines next to this row. If the number 8 is displayed in one field, each of the adjacent fields contains a mine.Don't know which field to click on next? Advance into unexplored terrain. It is better to click in the middle of an area of unmarked fields than in an area where you think there might be mines.Below is an example of a solved minefield. You can follow the marking logic using the individual numbers for the fields.

Play Minesweeper the right way

Applet

AI vs Minesweeper

Minesweeper Summary

Minesweeper is a simple computer game which comes with the operating system Microsoft Windows up to and including version Windows 7. It is a combination of logical thinking and (sometimes) random guessing which fields contain mines. The goal is to uncover all fields behind which no mines are hidden. An additional challenge is a stopwatch, so the game is mostly played for time.

Minesweeper History

Minesweeper was originally developed by Microsoft for Windows 3.1 and was then included with every successor version for the PC; since Windows 8 it has to be installed as an app from the Windows Store. The game is missing with Windows Mobile up to the version Windows Mobile 2003 SE. In many countries a free Xbox Live Minesweeper app is offered for Windows Phone via the integrated Windows Phone Store. With Windows Vista it was completely reworked and has for example the possibility to replace the mines with flowers. Minesweeper was also integrated into the 1999 Siemens S25 mobile phone.Records, which were achieved on Windows enclosed program versions, are not accepted for international and national best lists, because the current version gives the player the possibility to play on a playing field with the same mine positions several times in a row (restart) and previous versions are not safe against cheats and hacks. For competitions and rankings only the programs 'Minesweeper Arbiter', 'Minesweeper X' and 'Viennasweeper' are used. Based on Minesweeper, the paper-based game lighting was developed.

Minesweeper Overview

The original Minesweeper for Windows 3.x and 9x has four different difficulty levels:

  • Beginner: playing field of 8 times 8 (64) fields and 10 mines (16%).
  • Advanced: Field of 16 x 16 (256) fields and 40 mines (16%).
  • Professionals: Field of 30 x 16 (480) squares and 99 mines (21%).
  • User defined: Maximum size 30 times 24 (720) fields and 667 mines (93%).
In the Windows versions from Windows 2000 the beginner field size is 9 times 9 with the same number of mines as before (10, now 12%). This lower mine density results in an advantage compared to the 8 x 8 game fields in several games, since the number of clicks required for victory is reduced on average by a lower mine density.The user-defined mode of the versions Minesweeper Clone 2007 and Minesweeper X accepted for official rankings allow a maximum playing field size of 50 times 50 or the entire screen size.

Minesweeper Gameplay

At the beginning one of three difficulty levels is chosen, which determines the size of the playing field (number of fields) and the number of mines. Before the start of the game all fields are covered. The aim of the game is to uncover all fields behind which there is no mine.With the left mouse button the player uncovers a field; if there is a mine under this field, the game is lost. In the Windows versions and the versions accepted for rankings, however, the first click in normal game mode is never a mine. With the right mouse button he marks a field as a mine. A red flag then appears there. In order to undo this marking, one or two further right mouse clicks on the same field are sufficient (depending on the selected setting). To win, it is not necessary to mark mines with the right mouse button. It is sufficient to uncover all fields that do not contain mines with the left mouse button. Optionally, you can activate so-called markers if you are not sure whether there is a mine under a field. These appear in the form of a question mark on the fields and are also set with the right mouse button.Fields uncovered with the left mouse button that do not contain a mine reveal the number of mines located in the adjacent eight fields. An uncovered field surrounded by mines on all sides will show an 8. By the numbers of the uncovered fields it is usually possible to find out the whereabouts of the mines. If you double-click with the left mouse button on a uncovered field, in whose neighborhood all mines are already marked or click on it with the left and right mouse button at the same time, the remaining fields are uncovered all at once. A special role is played by fields that have no mines in their neighborhood: On the one hand, these do not show a 0, but are displayed in a different color. On the other hand, all still hidden fields in your neighborhood are automatically uncovered. If such a newly uncovered field is also a zero field, this process is continued recursively.At the start of the game and especially at the higher levels there are situations in which you can only guess under which field a mine is.

Destribution and variants

Minesweeper FlagsIn MSN / Windows Live Messenger there is the possibility to play against a contact in the list. In this version of the game there are 51 mines distributed on the field, the first thing to do is to uncover 26 mines. One field is uncovered alternately; whoever finds a mine may uncover one more. In addition, each player has the option to detonate a bomb once in each game, which will reveal a 5x5 field of his choice completely at once (if the player is behind).Do not mark mines (non-flagging - NF)In this version of the game the player does not mark any mines. So you are not allowed to use the right mouse button during the game. You have won automatically, if you have cleared all fields, except the mined ones, with the help of the left mouse button. The difficulty of this game variant lies in the fact that you have to remember the identified mine positions.In order to achieve best times on the beginner and advanced level, many professionals use this variant partially even on the whole playing field. Since the best times of the world's best players in the variant non-flagging are only slightly lower than their best times in the normal game and non-flagging is played less often, it can be assumed that non-flagging, although more difficult for the beginner, is not slower than flagging.Since 2009, in addition to the official world ranking, which includes both flagging and non-flagging games, there is also an official ranking, which is exclusively reserved for non-flagging best times.Increase mine densityAnother difficulty is the increase of the mine density in the custom/user defined variant. The starting point is usually the largest playing field, which is occupied by 99 mines in the standard variant. Such a field can still be solved with some practice; however, times under 150 seconds require good practice.However, clearing a square of this size becomes more difficult the more densely the square is occupied. Fields with 130 to 140 mines (28%) already have a very high degree of difficulty. Having even more mines laid already results in many failed attempts to get only a first approach to mine clearance.

Minesweeper Applet

A Processing project is an applet that inherits (extends) the PApplet class. The class extends (inherit from) the PApplet class that is defined in the processing.core package. The PApplet class has done a lot of the work of animation for us. It will connecting to the graphic features already available on your computer and provide an infinite loop that repeatedly draws the contents of the applet. All we need to do is learn the processing commands and how to draw figures, text, and other to the applet window. Sounds easy and it is ... at least for simple animations. Let's get started.

To change from a standard Java application to PApplet we need to add the processing.core package to our project.

Minesweeper

Minesweeper Appleton

Minesweeper Applet
  1. Click the Project folder (in the Package Explorer pane) to highlight the project.
  2. Click File -> Import.
  3. Expand the General menu
  4. Click File System and then Next
  5. Click Browse
  6. Navigate to the folder that you saved Processing files (or core.jar) and click Open.
    If logged into CS workstation, you can navigate to: S:processing-2.2.1amd64_rhel7corelibrary
  7. Select the core.jar file (see figure)
  8. Select Finish to complete the import (copy) operation.
    If Finish is grayed out, you may need to set the Into Folder field. Click the browse button and select the project folder you created earlier.

The core.jar file has now been copied to your project.

We must now tell Eclipse that this core.jar file should be included in the build path. The build path is the list of folders that contain existing byte code needed to compile our project. The standard JRE package is already in our build path and it's easy to add core.jar.

Right-click the core.jar file name in your package explorer view, and find the Build menu, select Add to build path from the Build menu. See figure below.

Voila. Now, we're ready make our class a Processing applet. At this point, your workspace should like this (or very similar):

  1. Open your MovingRectangle.java file for editing.
  2. Indicate that you wish for your class to inherit methods from the PApplet class by adding the extends PApplet clause to your class header (before the opening brace).

    This should cause Eclipse to complain. The errors are because class PApplet is not in the standard java.lang package.

  3. Add an import statment to your class file.

As long as there are no red compiler errors, you know that your processing library has been installed correctly. There is not much code, but let's 'run' it any way to see what happens.

  1. Click the Run button
  2. Click the Run as menu
  3. Click Java Applet

You should find that the Applet Viewer window has popped up.Not much going on yet, but there it is.

Minesweeper Applet Games

4. When you're done running an applet, click the red close button [X]to end the applet and close the window that was created for it.

The next step will make your applet draw something!


2015 Deb Deppeler

Minesweeper Applet Cheat