Skip to content

Ubersmake/minesweeper-wasm4-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

minesweeper-wasm4-rust

Another version of Minesweeper. This one is written in Rust for the WASM-4 fantasy console.

How to Play

The goal of Minesweeper is to uncover every tile that isn't a mine. Some tiles will reveal a number, which indicates the number of mines around that tile. Flagging a tile makes it impossible to accidentally uncover that tile until that flag is removed.

This implementation supports chording. When a tile's number is equal to the number of flags around it, "uncovering" the tile again will uncover every adjacent unflagged tile. If you've placed a flag on the wrong tile this might reveal a mine! And contrary to its namesake only one button is required to "chord."

The game has two difficulty settings:

  • Normal: 9 x 9 with 10 mines
  • Difficult: 15 x 12 with 25 mines

Implementation

There are three modes available. None use a no-guess generation algorithm, or for that matter implement any sort of solver to make that possible.

  • Classic: Board generation is as random as the code will allow. This brings it more in line with Microsoft Minesweeper that came bundled with older versions of Windows up to and including Windows XP.
  • Safe: The first uncovered tile is always safe.
  • Safer: The first uncovered tile and its neighbors are always safe.

Building

Build the cart by running:

cargo build --release

Grab a binary for your platform of choice from the latest WASM-4 release. Copy it to the project and run it with:

bin/w4 run target/wasm32-unknown-unknown/release/minesweeper.wasm

For more info about setting up WASM-4, see the quickstart guide.

Links

  • Documentation: Learn more about WASM-4.
  • Snake Tutorial: Learn how to build a complete game with a step-by-step tutorial.
  • GitHub: Submit an issue or PR. Contributions are welcome!

About

Minesweeper in WASM-4 and Rust

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages