Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The game of Minesweeper is a single-player puzzle game where the user is presented a grid of cells Underneath the cells are a number of

image text in transcribed
image text in transcribed
The game of Minesweeper is a single-player puzzle game where the user is presented a grid of cells Underneath the cells are a number of randomly placed mines. Consider the following screenshot of a game in process: NI New Pause Settings 378 25 19 5 5 5 24 216 2 2 7995 111 23 561111 #3 111111 3 2 2 144 11 11221 5 25 0 1 11 55 134 511 3663 3522 33531 11 1116 6 8231 1 1116 115 4.4.42116617911 11 2 2 211311 5 441 4146893 4 LL In the above example, the user will click on each cell in the grid. If a mine is clicked, the game is Immediately over and the player has lost. If the user didn't click on a mine, the a number is revealed to the user. This number is the number of mines in adjacent cells to the revealed number. Keep in mind that there are at- most eight cells adjacent to a cell. Corner cells only have three adjacent cells. Cellson the boundary of the game vary in count for adjacent neighboring cells. The game is won when the player has revealed all cells and not clicked on any lexploding) mines. It should be noted that your Submission shouldn't have all of the features shown in the above screenshot Requirements: For this assignment you are to implement a Vanilla JavaScript (ESS) version of Minesweeper. Feel free to use any HTML controls in your solution. Consider the following algorithm: 1. Generate a random nxm grid of cells for the user to click on, with and being the respective width and height of the grid. 2. After the user click 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.) a. If no mines are adjacent to the cel, simply place in the cell or shade the background a different color to show contrast to the user 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 amine 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 Glving the user the ability to floga cell (via mouse right click Ability for the user to play modes of difficulty, for instance Easy Mode might be a 10x10 grld 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 is shown in the cell. As an alternative, if the user click on a cell with no adjacent mines, you can reveal all "empty' cells (this will be demonstrated in class The game of Minesweeper is a single player puzzle game where the user's presented a grid of cells Underneath the cells are a number of randomly placed mines. Consider the following screenshot of a game in process LLLL 215 1 New Pause Settings 378 29 555 22795 111 23 14 561111 11111322 144 1121 535 5 111 55 134511 3663 3522 95 33531 111568233 1 1916 1156 4442116171 11 222111 44689 LLLLLLLL 1 In the above example, the user will click on each call the grid amines clicked, the game is immediately over and the player has lost. If the war die dick on a mine, the number is revealed to the user. This number is the number of mines in adjacent cells to the revealed number. Keep in mind that there are at most eight cells adiacent to acel Commerce is only have three adjacent cells. Celson the boundary of the game vary in count for adjacent neighboring cells. The game is won when the player has revealed all cells and not dicked on any exploding) mines. It should be noted that your submission shouldn't have all of the features shown in the above screenshot Requirements: For this assignment you are to implementa Vanille avaScript (ESS) version of Minesweeper. Feel free to use any HTMLScontrols in your solution. Consider the following algorithme 1. Generate a random nangid of cells for the user to click on, with and being the respective width and height of the grid 2 After the user dicks on acet, randomly placexmines on the grid with 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 dick and the game isn't lost on first 2. nomines are adjacent to the cel simply since in the cell or stade the background a Keep collecting clicks from the user, revealing the number of adjacent mines under each tile. 4. The games won when all ces not containing mines are exposed andamine was not clicked 5. The game is lost immediately when a mines dicked Points will be awarded based on correctness and certy. 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 flogace vie mouse right click Ability for the user to play modes of difficulty, for instance Easy Modemight be a 10x10 grid with 10 mines while Hard Mode might be 100 100 pred with mines these numbers are up to the developer:) . With the above implementation, if nomines are accent to a particular cell the number is shown in the cell. As an alternative, the user dicson a cell with no acent mines, you can reveal all empty cells this will be demonstrated in class. The game of Minesweeper is a single-player puzzle game where the user is presented a grid of cells Underneath the cells are a number of randomly placed mines. Consider the following screenshot of a game in process: NI New Pause Settings 378 25 19 5 5 5 24 216 2 2 7995 111 23 561111 #3 111111 3 2 2 144 11 11221 5 25 0 1 11 55 134 511 3663 3522 33531 11 1116 6 8231 1 1116 115 4.4.42116617911 11 2 2 211311 5 441 4146893 4 LL In the above example, the user will click on each cell in the grid. If a mine is clicked, the game is Immediately over and the player has lost. If the user didn't click on a mine, the a number is revealed to the user. This number is the number of mines in adjacent cells to the revealed number. Keep in mind that there are at- most eight cells adjacent to a cell. Corner cells only have three adjacent cells. Cellson the boundary of the game vary in count for adjacent neighboring cells. The game is won when the player has revealed all cells and not clicked on any lexploding) mines. It should be noted that your Submission shouldn't have all of the features shown in the above screenshot Requirements: For this assignment you are to implement a Vanilla JavaScript (ESS) version of Minesweeper. Feel free to use any HTML controls in your solution. Consider the following algorithm: 1. Generate a random nxm grid of cells for the user to click on, with and being the respective width and height of the grid. 2. After the user click 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.) a. If no mines are adjacent to the cel, simply place in the cell or shade the background a different color to show contrast to the user 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 amine 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 Glving the user the ability to floga cell (via mouse right click Ability for the user to play modes of difficulty, for instance Easy Mode might be a 10x10 grld 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 is shown in the cell. As an alternative, if the user click on a cell with no adjacent mines, you can reveal all "empty' cells (this will be demonstrated in class The game of Minesweeper is a single player puzzle game where the user's presented a grid of cells Underneath the cells are a number of randomly placed mines. Consider the following screenshot of a game in process LLLL 215 1 New Pause Settings 378 29 555 22795 111 23 14 561111 11111322 144 1121 535 5 111 55 134511 3663 3522 95 33531 111568233 1 1916 1156 4442116171 11 222111 44689 LLLLLLLL 1 In the above example, the user will click on each call the grid amines clicked, the game is immediately over and the player has lost. If the war die dick on a mine, the number is revealed to the user. This number is the number of mines in adjacent cells to the revealed number. Keep in mind that there are at most eight cells adiacent to acel Commerce is only have three adjacent cells. Celson the boundary of the game vary in count for adjacent neighboring cells. The game is won when the player has revealed all cells and not dicked on any exploding) mines. It should be noted that your submission shouldn't have all of the features shown in the above screenshot Requirements: For this assignment you are to implementa Vanille avaScript (ESS) version of Minesweeper. Feel free to use any HTMLScontrols in your solution. Consider the following algorithme 1. Generate a random nangid of cells for the user to click on, with and being the respective width and height of the grid 2 After the user dicks on acet, randomly placexmines on the grid with 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 dick and the game isn't lost on first 2. nomines are adjacent to the cel simply since in the cell or stade the background a Keep collecting clicks from the user, revealing the number of adjacent mines under each tile. 4. The games won when all ces not containing mines are exposed andamine was not clicked 5. The game is lost immediately when a mines dicked Points will be awarded based on correctness and certy. 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 flogace vie mouse right click Ability for the user to play modes of difficulty, for instance Easy Modemight be a 10x10 grid with 10 mines while Hard Mode might be 100 100 pred with mines these numbers are up to the developer:) . With the above implementation, if nomines are accent to a particular cell the number is shown in the cell. As an alternative, the user dicson a cell with no acent 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

Students also viewed these Databases questions

Question

2. How should this be dealt with by the organisation?

Answered: 1 week ago

Question

explain what is meant by the term fair dismissal

Answered: 1 week ago