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 firstCat = { name: 'Muffin', points: 0 }; var secondCat = { name: 'Rudolph', points: 0 }; 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 firstCat = { name: 'Muffin', points: 0 }; var secondCat = { name: 'Rudolph', points: 0 }; 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>Delete all parameters except quantity in <em>declaration</em>of runGame function and add new parameters: firstPlayer and secondPlayer.</li>
6
<ol><li>Delete all parameters except quantity in <em>declaration</em>of runGame function and add new parameters: firstPlayer and secondPlayer.</li>
7
<li>Delete all arguments except diceNumber in the<em>call</em>of runGame function and add new arguments: firstCat and secondCat.</li>
7
<li>Delete all arguments except diceNumber in the<em>call</em>of runGame function and add new arguments: firstCat and secondCat.</li>
8
<li>In the body of the function, replace firstPlayerPoints with firstPlayer.points, firstPlayerName with firstPlayer.name.</li>
8
<li>In the body of the function, replace firstPlayerPoints with firstPlayer.points, firstPlayerName with firstPlayer.name.</li>
9
<li>Similarly, replace variables with objects for the second player.</li>
9
<li>Similarly, replace variables with objects for the second player.</li>
10
<li>Delete variables firstCatName, firstCatPoints, secondCatName, secondCatPoints.</li>
10
<li>Delete variables firstCatName, firstCatPoints, secondCatName, secondCatPoints.</li>
11
</ol>
11
</ol>