A simple HTML based Minesweeper game
I am posting 3 files: index.html minesweeper.js minesweeper. Stack Exchange Network. Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn. Simple minesweeper game in JavaScript. Ask Question 3. 2 $ begingroup $.
Playable demo: http://vincentchen.me/works/minesweeper/index.html
- Use CSS/HTML to create the classic Windows Minesweeper game UI.
- Use JavaScript to implement game logic.
- Tutorial:
- Click left mouse button to uncover a block.
- Click right mouse button once to place a flag mark, click right mouse button twice to place a question mark, click right mouse button three times to clear all marks.
- Click middle mouse button on any uncovered block to perform a quick uncovering for surrounding blocks.
- Tested on Chrome, other browsers are not guaranteed.
- This game is modified from a very old code base I wrote in 2005.
- Original version (only support IE7 or earlier): http://vincentchen.me/works/NixMine/index.html
- Currently implementation is still not good, I will keep refactoring it.
By Michael Butler
A WebWorker powered Minesweeper game written in JavaScript, HTML and CSS.
Demo: http://michaelbutler.github.io/minesweeper/
Features:
- User can choose difficulty level
- Custom option with configurable grid size (X, Y) and number of mines
- Stopwatch with score keeping (LocalStorage)
- Stack based grid traversal algorithm for memory efficiency
- HTML5 web worker (if supported) will be used to perform the stack algorithm outside of the UI thread
How to use:
Download all the files and open
index.html
in a modern web browser.Example HTML usage:
To Do:
- Add animation and better graphics
- Enhance UI for a sleek new look
Contributing:
See CONTRIBUTE.md for how to contribute.