Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me make Minesweeper game with Vanilla Javascript Requirements: For this assignment you are to implement a Vanilla JavaScript (ES5) version of Minesweeper. Feel

Please help me make Minesweeper game with Vanilla Javascript

image text in transcribed

Requirements: For this assignment you are to implement a Vanilla JavaScript (ES5) version of Minesweeper. Feel free to use any HTML5 controls in your solution. Consider the following algorithm: Generate a random n x m grid of cells for the user to click on, with n and m being the respective width and height of the grid. After the user clicks on a cell, randomly place x mines on the grid (with x being the number of mines for your game.) Don't place a mine on the cell the user clicked on. (This is so the user gets one free click and the game isn't lost on first try.) 1. 2. If no mines are adjacent to the cell, simply place O in the cell or shade the background a different color to show contrast to the user. a. 3. Keep collecting clicks from the user, revealing the number of adjacent mines under each tile. 4. The game is won when all cells not containing mines are exposed and a mine was not clicked. 5. The game is lost immediately when a mine is clicked. Points will be awarded based on correctness and creativity. Some features that aren't required but are nice to have include: .Changing the color of the number of adjacent mines of a cell . Giving the user the ability to flag a cell (via mouse right click) Ability for the user to play modes of difficulty, for instance Easy Mode might be a 10x 10 grid with 10 mines while Hard Mode might be a 100 x 100 grid with 60 mines (these numbers are up to the developer.) .With the above implementation, if no mines are adjacent to a particular cell the number 0 is shown in the cell. As an alternative, if the user clicks on a cell with no adjacent mines, you can reveal all "empty" cells (this will be demonstrated in class.)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

More Books

Students also viewed these Databases questions