Giter Club home page Giter Club logo

piccollage-minesweeper's Introduction

Minesweeper Game in Java

This Minesweeper game is a simple console-based implementation of the classic game where players uncover tiles on a grid without hitting mines. This implementation allows customization of the grid size and the number of mines.

Features

Customizable board size: Players can define the width and height of the game board. Customizable mine count: Players can set the number of mines on the board. Automatic win/loss detection: The game automatically detects and announces a win or loss condition.

Prerequisites

To run this game, you will need:

Java Runtime Environment (JRE) or Java Development Kit (JDK) version 8 or higher.

Installation

No installation is required. You only need to have Java installed on your machine.

Running the Game

To run the game, follow these steps:

  1. Download the source code: Clone or download the zip file of the project to your local machine.
  2. Navigate to the project directory: Open your command line interface (CLI) and navigate to the directory where the project files are located.
  3. Compile the Java program: javac Minesweeper.java
  4. Run the compiled Java program: java Minesweeper
    Follow the on-screen prompts in the terminal to start playing the game. You will be asked to enter the number of rows, columns, and mines you would like on the board.

How to Play

Upon starting the game, enter the dimensions of the board and the number of mines. Input coordinates to reveal a spot on the board. The format is row col, where row is the row number and col is the column number. Both start from 0. The game will reveal the cell at the specified coordinates. If you hit a mine, the game ends. Otherwise, it will either show a number (indicating the number of adjacent mines) or automatically reveal adjacent areas if there are no adjacent mines. Continue revealing cells until all non-mine cells are revealed to win the game. At any time after revealing a mine, you can choose to restart the game or exit.

piccollage-minesweeper's People

Contributors

jasonhsu93 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.