Skip to content

okturan/MineSweeper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Minesweeper

This repository contains the Java code for a console version of the Minesweeper game with customizable board size and mine density.

Features

  • Customizable Board Dimensions: Allows the player to set the number of rows and columns.
  • Mine Density: Initially set at 25%, but adjustable.
  • Cheat Mode: Displays the location of all mines on the board when enabled. Disable by setting cheatMode to false.

How to Play

  1. Setup: Players are prompted to enter dimensions for the Minesweeper board.
  2. Game Play: Players choose cells to reveal. Revealing a mine results in defeat, while revealing all non-mine cells results in a win.
  3. Reveal Cells: Each revealed cell will display either a mine or the number of adjacent mines.

Game Code Structure

  • Main.java: Contains the main method for initiating the game.
  • MineSweeper.java: Includes the game logic, such as board setup, gameplay loop, and display functions.

Running the Game

Compile the Main.java and MineSweeper.java files and execute the Main class:

javac Main.java MineSweeper.java
java Main

License

This Minesweeper game is open-sourced software licensed under the MIT license.

About

Java implementation of Minesweeper that supports customizable board sizes and mine densities, with an optional cheat mode.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages