Simple Console Based Minesweeper Game

Posted on by
Simple Console Based Minesweeper Game Average ratng: 3,0/5 6313 votes

50 Games like Minesweeper for PC Windows, daily generated comparing over 40 000 video games across all platforms. Cubicolor is a minimalist puzzle game. The rules are simple: Match the color patches on the board and reach the exit, all on one single path. Created by two brothers, Coffee Pot Terrarium is a turn-based puzzle game of tile. Minesweeper Program in C [console run program] Building a simple Minesweeper program on a 32 Bit Linux machine with 2011 C using GCC. Program take arguments from command line and run on command console. Below is the syntax. Java Minesweeper m n p * * Creates an MxN minesweeper game where each cell is a bomb with * probability p. There are simple games of strategy and reflex, such as minesweeper and snake, and there are very complex games such as the real-time-strategy game StarCraft. People play simple computer games online for free all the time as a quick diversion, but this paper will focus on the more complex, developed games that more easily compare to console gaming in terms of design, form of lasting entertainment, and relevancy to consumers. Pretty cool, though entirely text based. Just something I did for fun to brush up on my coding practice and as an excuse to post another video. Check out my other simple c++ games, they're pretty. Minesweeper (simple) in c# [closed] Now what I want to do is, for example the user would enter a string and the string would be B4. Then the program would check that and see if the field that the user selected is a mine (0) or a bomb (1). If it is a bomb it would also say how many bombs (1's) are nearby. I have no idea how to do this. Recently I've gotten to thinking about what it would take to implement a simple console based minesweeper game, what data structures and algorithms would be needed for a bare-minimum playable game. No variations on game size, difficult, etc.



Software 81-120 of 120
3DMinesweeper1.0 2D, 2.5D and 3D minesweeper. Play minesweeper in space.
GNU Library or Lesser General Public License (LGPL)
Minesweeper3D1.1.1 Minesweeper 3D
In Minesweeper 3D you have on one hand the original gameplay, but from a three-dimensional view. On the other hand the game allows you to play a bigger field, with even more ..
MinesweeperVariants11 This is a minesweeper game with more than 50 variants.
Minesweeper is a logical game, in the game the player will have to find out all the mines in the field according to the hints given.
MinesweeperSound1.1.9 Minesweeper Sound is a game based on the popular minesweeper also called mines. The objective of the game is to clear all the mines hidden on the battlefield.
The main novelty of the game, is that ..
Autosweep1.0 Increase your Minesweeper score by finding all the right moves.
MineSweeperSolver16 This program tries to solve the game of minesweeper. It will never guess, I have never seen it make a mistake (if it happens with you, make sure you didn't move the mouse in the minesweeper window while ..
BattlefieldMinesweeper1.0 Bored with the original minesweeper game? Building off of the classic Minesweeper appeal, we have made this version more exciting with explosions that will rock your screen. Set in a military theme environment, ..
ExtremeSweepRc.0.4 ExtremeSweep is another one of many Minesweeper clones. This one has a few features that the others don't, however, such as different board types (ie, different button shapes), extreme levels, a GPL ..
Self-SolvingMinesweeperClone1.0 Self-Solving Minesweeper Clone
GNU General Public License (GPL)
JavaMineSweeper3D1.0 J3DMineSweeper is a 3D minesweeper written in Java.
GNU General Public License (GPL)
MultiPlayerMineSweeper3.1 The World MineSweeper Network, is a worldwide server, that allows people from all over the world to play multi player minesweeper over the internet. There are two ways to play Multi Player Minesweeper.
ArcheryScoreSheets2.0 ARCHERY SCORE SHEETS
Say goodbye to paper-based target score sheets!
This app is designed to replace FITA and GNAS paper-based target archery score sheets with a digital equivalent, in a format ..
MinesweeperForJava1.0 This is a Minesweeper clone written in Java. It's my first game and I had a lot of fun to build it. If you enjoy it, please add a review :-)
GNU General Public License version 2.0 (GPLv2)
YetAnotherMineSweeper1.0 Just another MineSweeper written in java with OO design in mind.
GNU General Public License (GPL)
MinesweeperForLinux1 minesweeper is a very simple minesweeper clone written in Python and PyGame.
MineSweeperRobot1.0 A java-based MineSweeper Game Auto-Playing Robot. It can help you to play MineSweeper game automatically.Java
GNU General Public License (GPL)
Mission: Minesweeper2.0 Minesweeper like you've never seen it before. This update of the classic minesweeper game has all the strategy of the original with a fresh new look and enhanced gameplay. It's everything you love about ..
Xyuri_minesweeper1.0 simple terminal / console based minesweeper game. I am in the process of learning C++ and in doing so am porting my VB.NET minesweeper game to a C++ version, but will now be in a console.
GNU ..
SundaySweeper1.0 Implementation of minesweeper to be extended and made more fun.
GNU Library or Lesser General Public License (LGPL)
UltimateMinesweeperFree1.35 Can you clear the minefield without hitting a mine? Put your wits to the test in this enhanced version of the classic game Minesweeper.
We've taken Minesweeper to the next level with extra ..
Mines-Perfect140 Mines-Perfect is an improved minesweeper-clone. Highlights: solveable-guarantee (never guess anymore), murphy's law option (if you uncover a field and there could theoretical lies a mine, then there ..
DoubleSapper1.25 This Minesweeper game gives you possibility to play with computer or your firends.As in other Minesweeper games you have to find all mines in game area and mark them with flags. But unlike them you can ..
AdvancedMinesweeperForIPhone & IPod1.0 The Best Mind sharpening game whole the world and all the time, is a MINESSWEEPER . Advanced Minesweeper game makes you Surprise.In fact it is classy but twisty.
Minesweeper is the best puzzle game ..
SimpleConsoleMinesweeperInPython1.0 A simple text based Minesweeper game made in Python. Currently available in .exe and source. Notice: A minor error: 'clrField failed' may appear, as far as I know this is not correct as it still ..
MinesweeperProfessional1.0 Love to play classic minesweeper but looking for a better and fresher way to play it?.. This is it!
We've been working hard to develop the best minesweeper in the App Store; some of the main features ..
MinesSweeper - Brandtologie1.0 Tease your brain and challenge your capability to mine sweep with this new game that does not allow you to flag the mines.
Welcome to our version of the Minesweeper - a single-player video ..
GuitarHeroScoreCharts1.0 Tired of dragging your computer into your gaming room just to upload scores to score hero? Want to keep track of your scores, and have a hard copy in case Score Hero explodes? Get GH score sheets!
DownloadView Info
FastMines2.2007.2.12 The ultimate Minesweeper clone with new exciting features and capabilities!
- various mosaics (20 types) : quadrilaterals, triangles, pentagons, hexagon
- safe territory ..
SuperMinesweeper1.12 Super Minesweeper takes your classic minesweeper gameplay and adds several new features to the mix. You can play on many different board styles such as squares, hexagons, rectangles, skewed squares, intricate ..
JBombSweeper - ANiceJavaMinesweeperBeta.6.0 Is a Minesweeper clone written in Java. It was done because I was bored xD. I'm still working on it.. and I'm thinking about making it Online soon. :-)
ColorSheets1.0.4 Color Sheets are simple note sheets which can it is useful at any time when work on a computer. In these sheets it is possible to write down the short information. Everything that you have written down ..
MineSweeperEngine1.0 A C# engine for the popular MineSweeper style puzzle game. Easy to extend and integrate into new projects. See the engine in action: http://www.kongregate.com/games/pintsized/electronminefield

DownloadView Info
MineSweeperForIPad1.0 Minesweeper is a single-player video game. The object of the game is to clear an abstract minefield without detonating a mine. The game has been written for many system platforms in use today.
Minesweeper ..
Elemines0.2.1 Elemines is a clone of minesweeper using the Enlightenment Foundation Libraries.
BSD License; GNU General Public License version 2.0 (GPLv2); Open Font License 1.1 (OFL 1.1)
SuperMineSweeperHD1.6 ? HALF PRICE SALE for a limited time ?
The popular game Super MineSweeper is now on iPad. The whole user interface is re-made to take advantage of the iPad high resolution screen, the game ..
MinesweeperPremium1.0.0.0 Do you have what it takes to clear the minefield without hitting a mine? Meet one of the best versions of Classic Minesweeper for your Windows Phone!
The game is taken to the next level with ..
JsMinesweeper0.1.5 This is a game based on the classic game 'Minesweeper'. JsMinesweeper is written using only JavaScript, HTML and CSS. It supports all the original functionality of minesweeper as well as a couple ..
Minesweeper1.2 Minesweeper is an interesting puzzle game for free. You target is to find those invisible mines in a limit time. Click on you left mouse key to selects and opens the square on the sand map to reveals ..
GameTrium: ThreeGamesInOne1.0 Download GameTrium: three games in one!
Play 5 in a Row, Memory and Minesweeper in one and have joy!
5 in a Row:
Requires a row of exactly five stones for a win.
Memory: ..

Minesweeper Game Official

MobiMines1.0 The classical puzzle game Minesweeper adapted to mobile devices.
GNU General Public License (GPL)
a b c d e f g h i j k l m n o p q r s t u v w x y z
Home New Software Top Software Submit Software RSS Feeds Link to Us Contact

In this part of the Java 2D games tutorial, we create a Minesweeper game clone. Source code and images can be found at the author's Github Java-Minesweeper-Game repository.

Minesweeper

Minesweeper is a popular board game shipped with many operating systems by default. The goal of the game is to sweep all mines from a mine field. If the playerclicks on the cell which contains a mine, the mine detonates and the game is over.

A cell can contain a number or it can be blank. The number indicateshow many mines are adjacent to this particular cell. We set a mark on a cellby right clicking on it. This way we indicate that we believe, there is a mine.

Development of Java Minesweeper game

The game consists of two classes: Board and Minesweeper.We have thirteen images in the src/resources directory.

com/zetcode/Board.java

First we define the constants used in our game.

There are thirteen images used in this game. A cell can be surrounded by maximum of eight mines, so we need numbers one through eight. We need images for an empty cell, a mine, a covered cell, a marked cell and finally for a wrongly marked cell. The size of each of the images is 15x15 px.

A mine field is an array of numbers. For example, 0 denotes an empty cell. Number 10 is used for a cell cover as well as for a mark. Using constants improves readability of the code.

The MINE_CELL represents a cell that contains a mine.

The COVERED_MINE_CELL is used for a field that is coveredand contains a mine. The MARKED_MINE_CELLcode> is a covered mine cellthat was marked by the user.

These contants determine whether to draw a mine, a mine cover, a mark, and a wrongly marked cell.

The minefield in our game has fourty hidden mines. There are sixteen rows and sixteen columns in the field. So there are two hundred and twenty-six cells together in the minefield.

The field is an array of numbers. Each cell in the field has a specific number. For instance, a mine cell has number 9. A cell with number 2 means itis adjacent to two mines. The numbers are added. For example, a covered mine has number 19, 9 for the mine and 10 for the cell cover and so on.

The inGame variable determines whether we are in the gameor the game is over.

The minesLeft variable the number of mines to be marked left.

We load our images into the image array. The images are named 0.png, 1.png .. 12.png.

The newGame() initiates the Minesweeper game.

These lines set up the mine field. Every cell is covered by default.

In the while cycle we randomly position all mines in the field.

Each of the cells can be surrounded up to eight cells. (This does not apply to the border cells.) We raise the number for adjacent cells for each of the randomly placed mine. In our example, we add 1 to the top neighbour of the cell in question.

In the find_empty_cells() method, we find empty cells. If the player clicks on a mine cell, the game is over. If he clicks on a cell adjacent to a mine, he uncovers a number indicating how many mines the cell is adjacent to. Clickingon an empty cell leads to uncovering many other empty cells plus cells with a number that form a border around a space of empty borders. We use a recursive algorithm to find empty cells.

In this code, we check the cell that is located to the left to an empty cell in question. If it is not empty, it is uncovered. If it is empty, we repeat the whole process by recursively calling the find_empty_cells() method.

The paintComponent() method turns numbers into images.

If the game is over and we lost, we show all uncovered mines if any and show all wrongly marked cells if any.

This code line draws every cell on the window.

If there is nothing left to uncover, we win. If the inGame variable was set to false, we have lost.

In the mousePressed() method we react to mouse clicks. The Minesweeper game is controlled solely by mouse. We react to left and right mouse clicks.

We determine the x and y coordinates of the mousepointer. Xbox action replay codes.

We compute the corresponding column and row of the mine field.

We check that we are located in the area of the mine field.

The uncovering of the mines is done with the right mouse button.

If we right click on an unmarked cell, we add MARK_FOR_CELL to the number representing the cell. This leads to drawing a coveredcell with a mark in the paintComponent() method.

Simple Console Based Minesweeper Games

If we left click on a cell that has been already marked, we remove the mark and increase the number of cells to be marked.

Nothing happens if we click on the covered and marked cell. It must by first uncovered by another right click and onlythen it is possible to left click on it.

A left click removes a cover from the cell.

In case we left clicked on a mine, the game is over. If we left clickon an empty cell, we call the find_empty_cells() method which recursively finds all adjacent empty cells.

If the board needs to be repainted (for instance a mark was set or removed),we call the repaint() method.

This is the main class.

The window has fixed size. For this, we use the setResizable() method.

Console Based

In this part of the Java 2D games tutorial, we created a Java clone of the Minesweeper game.