Giter Site home page Giter Site logo

minesweeper's Introduction

Minesweeper

A minesweeper game using WASM-4 engine

https://gitlab.com/claudiomattera/minesweeper/

This game is a reimplementation of the classical Minesweeper game.

Screenshot

Playing

The goal of the game is to find all mines covered by a grid of tiles, by uncovering all safe tiles. Uncovering a mine means game over!

The game is controlled through the mouse. Left click on a tile to uncover it, right click on a tile to flag it.

Uncovered tiles show the number of adjacent mines, both vertically, horizontally and diagonally (or nothing, when there are no adjacent mines).

Flag tiles which you believe cover a mine. After uncovering a tile, if the number of adjacent flagged tiles is equal to the number of adjacent mines, all non-flagged adjacent tiles are also uncovered. Simultaneous left and right click on a numbered uncovered tile will uncover adjacent tiles.

Implementation

This game is implemented in Rust using the toolkit WASM-4. It is a bit over engineered, but it was a fun project to learn WASM-4 and improve knowledge about Rust.

The game can be embedded in a web page using WebAssembly. A standalone cartridge can be created with the following commands.

cargo build --release
w4 bundle target/wasm32-unknown-unknown/release/minesweeper.wasm
      --title "Minesweeper"
      --description "A minesweeper game using WASM-4 engine"
      --timestamp
      --html ./cartridge.html

License

Copyright Claudio Mattera 2021

You are free to copy, modify, and distribute this application with attribution under the terms of the MPL 2.0 license. See the License.txt file for details.

minesweeper's People

Contributors

claudiomattera avatar

Watchers

James Cloos avatar  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.