Skip to content

Commit 4f2ecd9

Browse files
committed
WIP
1 parent 593afe1 commit 4f2ecd9

File tree

1 file changed

+5
-0
lines changed
  • JS_Basic_Challenges/4-DOM-pig-game/starter

1 file changed

+5
-0
lines changed

JS_Basic_Challenges/4-DOM-pig-game/starter/app.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,8 @@ var currentScore = 0; // the score each player has per round/ session, whe
1818
var activePlayer = 0; // the player that is currently rolling the dice
1919

2020
dice = Math.floor(Math.random() * 6) + 1; // create a dice that generates a random number from 1 to 6 (included)
21+
22+
// document.querySelector('#current-' + activePlayer).textContent = Math.floor(Math.random() * 6) + 1;
23+
document.querySelector('#current-' + activePlayer).textContent = dice;
24+
// The textContent property sets or returns the text content of the node you specify. In our case, that's the dice value of the player rolling it.
25+

0 commit comments

Comments
 (0)