Giter VIP home page Giter VIP logo

minesweeper's Introduction

Minesweeper

Minesweeper is a computer game where players clear a grid of hidden mines without detonating any. They use numeric clues to deduce the locations of mines and clear all non-mine squares to win.

Side notes

  • bombs are seeded randomly across the grid. each tile has a chance of containing a bomb, with the exception of the 1st tile clicked by the player

  • when a tile is clicked, if it doesn't contain a bomb, it reveals either a number indicating the count of adjacent bombs or recursively reveals neighboring tiles until reaching tiles adjacent to bombs. this process continues until all tiles adjacent to bombs are revealed

  • players can flag tiles they suspect contain bombs to avoid accidental clicks or to mark potential bomb locations. flagging is typically done by right-clicking on the tile

  • the game is won when all non-bomb tiles are revealed and correctly flagged. this means all safe tiles are uncovered, and all bombs are flagged

Must have

  • generate map
  • create button cells
  • set button context menu for toggle flag
  • generate and seed bombs
  • add game restart
  • process cell revealing
  • process game winnings
  • stop the timer when you win, when you lose, reset the timer when you restart

Nice to have

  • refactor this mess of code
  • add some tests
  • stylize the map and cells
  • show timer
  • in case of winning, save the score to table based on spent time
  • add difficulty levels
    • beginner 9x9, 10 bombs
    • intermediate 16x16, 40 bombs
    • expert 16x30, 99 bombs
  • calculate score based on time spent and level of difficulty

minesweeper's People

Contributors

hnatiukr avatar

Watchers

 avatar

Forkers

drizzer14

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.