0 added
0 removed
Original
2026-01-01
Modified
2026-03-09
1
<ul><li>script.js</li>
1
<ul><li>script.js</li>
2
</ul><p>JavaScript</p>
2
</ul><p>JavaScript</p>
3
<p>var diceNumber = 2; var firstCatName = 'Muffin'; var firstCatPoints = 0; var secondCatName = 'Rudolph'; var secondCatPoints = 0; var runGame = function (quantity, firstPlayerName, firstPlayerPoints, secondPlayerName, secondPlayerPoints) { firstPlayerPoints += muffin.throwDice(quantity, quantity * 6); secondPlayerPoints += muffin.throwDice(quantity, quantity * 6); console.log(firstPlayerName + ' rolled ' + firstPlayerPoints); console.log(secondPlayerName + ' rolled ' + secondPlayerPoints); }; runGame(diceNumber, firstCatName, firstCatPoints, secondCatName, secondCatPoints);</p>
3
<p>var diceNumber = 2; var firstCatName = 'Muffin'; var firstCatPoints = 0; var secondCatName = 'Rudolph'; var secondCatPoints = 0; var runGame = function (quantity, firstPlayerName, firstPlayerPoints, secondPlayerName, secondPlayerPoints) { firstPlayerPoints += muffin.throwDice(quantity, quantity * 6); secondPlayerPoints += muffin.throwDice(quantity, quantity * 6); console.log(firstPlayerName + ' rolled ' + firstPlayerPoints); console.log(secondPlayerName + ' rolled ' + secondPlayerPoints); }; runGame(diceNumber, firstCatName, firstCatPoints, secondCatName, secondCatPoints);</p>
4
<p>Thanks! We’ll fix everything at once!</p>
4
<p>Thanks! We’ll fix everything at once!</p>
5
<h2>Result</h2>
5
<h2>Result</h2>
6
<ol><li>Before the runGame function, add the first player object firstCat.</li>
6
<ol><li>Before the runGame function, add the first player object firstCat.</li>
7
<li>Add the property with the player’s name: key name, value 'Muffin' to object firstCat.</li>
7
<li>Add the property with the player’s name: key name, value 'Muffin' to object firstCat.</li>
8
<li>After the firstCat object, add the secondCat object with the name 'Rudolph'.</li>
8
<li>After the firstCat object, add the secondCat object with the name 'Rudolph'.</li>
9
<li>Add to each object a property for storing the points: key points, value 0.</li>
9
<li>Add to each object a property for storing the points: key points, value 0.</li>
10
</ol>
10
</ol>