Giter Site home page Giter Site logo

MineSweeper

Table of Contents

  1. Game Explaination
  2. Game description
  3. User Stories
  4. Technologies used
  5. Pseudocode
  6. Quick Start

The player aims to explore the field without hitting a mine. When it explores a cell with a mine, the game is lost. When it opens a mine-free cell, it learns how many adjacent cells contain a mine. This number is displayed in every cell. From this information, the agent tries to infer which adjacent cells are safe or contain a mine. Known mines are flagged dangerous with a red flag symbol.

Among the width × height cells on the field, n_mines cells contain a mine. The goal of the agent is to identify these mines.

The goal state is to explore all cells that contain no mine, and to flag all cells contain a mine.

On every turn, the player selects a cell and either explores it or flags it as mine. When a cell that contains a mine is explored, the game is lost. When the cell contains no mine, the agent learns how many adjacent cells (0 ≤ N ≤ 8) contain mines. (When N = 0, the adjacent cells are explored immediately.) When a cell is known to contain a mine, it can be flagged as such, as a mental note not to consider it for future exploration. Explored cells are visualized as their number N, or a mine symbol when they contain a mine (in which case the game is lost), and flagged cells are marked by a red flag.

The game is won when all non-mine cells are explored and all mine cells are flagged. The game is lost when the agent explores a mine cell.

  • As a newbie game player, I want to know the game instruction.
  • As a player, I would like to reset my game any time during the game.
  • As a player, I would like to know the time taken to complete the game.
  • As a player, I want to be able to flag or unflag any cell in the grid.
  • As an player, I want to be able to customize the game difficulty based on my prefrence.
  • As a player, I want to see how much bomb left for me.

This game was written using html, CSS, JavaScript(ES6) and Material Design Bootstrap(UI)

On start the game will generate rows*cols cells and assigned n mines in random places and bind the event for unmasking and flag and update the number of moves and bomb count based on moves using updateFeedback().

Opening adjacent empty cells

when player clicks a cell, the unmasked class will be add and which will control the display of the cell. Then, the mouse click will be disabled on that clicked cell. The timer will start with the first left click on the grid.

When player clicks empty cell, the surrounded cells - if blank which mean empty cell -will open up until a number or bomb or boundary is reached using recursive function.

Player will win After opening all the cells without clicking on any bomb.

How to use

Download all the files and open index.html in a modern web browser.

arockiajeyson's Projects

cricketweapon-store icon cricketweapon-store

Experience top-tier online shopping with CricketWeapon, an advanced MERN stack e-commerce platform. Explore a diverse product catalog, streamline user profiles, track orders, and harness comprehensive admin features. Elevate your retail journey with our powerful MERN technology stack and dynamic interface!",Built with MongoDB, Express, React, Node.

ecommerce-mew icon ecommerce-mew

MEW (Men's Ethnic Wear) is an ecommerce web application using MERN stack.

express-hello-world icon express-hello-world

Implements the Expressjs Hello World example to provide a faster start deploying on the Cyclic platform

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.