This Minesweeper game is implemented in Go, utilizing the ebiten, a 2D game engine, and ebitenui, a user interface engine, for rendering graphics and user interface elements. The code is structured into three main packages: model, view, and controller, each responsible for different aspects of the game.
Contains the data structures (2D array) and logic underlying the game. This includes the definitions of the game board, cells, and game state.
Contains all of the code related to rendering the game to the screen. This includes the definitions of the game window, board, cells, and header user interface elements.
The controller package acts as a bridge between the model and view packages. It contains functions that handle user interactions and update the game state accordingly.
Minesweeper is a classic puzzle game. The objective is to clear a board containing hidden "mines" without detonating any of them, with help from clues about the number of neighboring mines in each field. The game is won when all safe cells are revealed, and lost when a mine is revealed.
-
Install Go, if not already installed.
-
Clone or download this repository.
-
Navigate to the directory containing your Go files in a terminal.
-
Run the command
go build .to build the executable file for the game.- A file named
Minesweeper.exewill be created in the same directory.
- A file named
-
Running the executeable
-
Through TerminaL:
-
On Windows:
.\Mineweeper.exe -
On Linux/macOS:
./Minesweeper
-
-
Alternatively, you can double-click the executable file to run it in File Explorer/ Finder depening on your OS.
-