Giter VIP home page Giter VIP logo

loilei / minesweeper-java Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 77 KB

Minesweeper is a single player game. In this game we have a field (grid with squares) with some hidden bombs and the goal is to open/clean all the squares without a bomb and if the player hits a bomb, then s/he loses the game. If the player can open all the squares without a bomb, then s/he wins the game!

Java 100.00%

minesweeper-java's Introduction

minesweeper-java

Minesweeper is a single player game. In this game we have a field (grid with squares) with hidden bombs and the goal is to open/clean all the squares without a bomb and if the player hits a bomb, then s/he loses the game. If the player can open all the squares without a bomb, then s/he wins the game!

Installation

The game can be played both in IDE or console. Please note that both Java and Maven must be using java version 17 for the build to work.

IDE

Here is what you need to do to set up the project:

  1. Clone or download .zip file from https://github.com/Loilei/minesweeper-java.git
  2. Open the project using any Java-friendly IDE
  3. Go to src/main/java/com.marcela/Main.java
  4. Run main method in Main.java class

CONSOLE

  1. Open command and navigate to the main folder /minesweeper-java
  2. Type 'mvn install' to build the project
  3. Go to 'target' folder (cd target)
  4. Type java -jar minesweeper-java-1.0-SNAPSHOT-jar-with-dependencies.jar

How to play

The win condition is to reveal all tiles that do not contain bomb.

The tile types are as follows:

  • '[X]' - tile with exploded bomb
  • '[_]' - unrevealed tile
  • '[F]' - flagged tile (marked bomb)
  • '[3]' - safe tile with the amount of neighbour bombs

The board size can be chosen by the user from range 5 to 10. Board bigger or smaller than the given range will not be generated.

To play the game simply follow the instructions displayed in terminal. Until you hit the bomb or reveal the whole board, the game will keep asking for coordinates and action on chosen tile.

If you hit the bomb the game will restart using the same bomb placement.

If you win the game will ask you if you wish to play again, but the board will be generated randomly again.

At any time when inputting coordinates or action you can type 'quit' and the game will be terminated.

minesweeper-java's People

Contributors

loilei avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.