You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: minesweeper-game/README.md
+7-1
Original file line number
Diff line number
Diff line change
@@ -2,13 +2,17 @@
2
2
3
3
## HTML
4
4
5
-
1. Create <div> with grid class in the body of HTML.
5
+
1. Create div with grid class in the body of HTML.
6
6
2. Elements will be dynamically added to this grid div using JS.
7
+
3. Add a result heading to display Scores of player.
8
+
4. Create a button Restart that will reload the game.
7
9
8
10
## CSS
9
11
10
12
1. Create a grid layout with 10x10 boxes of 40px each, hence grid size will be 400x400px
11
13
2. Specify the size of each box separately, using .grid div { height: 40px; width: 40px; }
14
+
3. Align the headings & elements to the center.
15
+
4. Make text as bold and use border for better visualization of the game's grid.
12
16
13
17
## JavaScript Code
14
18
@@ -26,6 +30,8 @@
26
30
13. Create addFlag() method, to add flags on the boxes that have bomb element and are right clicked by the player, to mark as safe.
27
31
14. Use onContextMenu property in createBoard(), that calls addFlag() on right click on a box with bomb element.
28
32
15. Create a gameWin() method to check if the number of flags added by the player matches the total number of bombs. If yes, then the player is declared as Winner. This method is called everytime a flag is added to the game board.
33
+
16. Update the Scores on click of a valid box in the game.
34
+
17. Enable the button restart when the player wins or looses the game.
0 commit comments