Interactive online courses HTML Academy
2026-03-09 10:58 Diff
  • script.js

JavaScript

var diceNumber = 2; var firstCatName = 'Muffin'; var firstCatPoints = 0; var secondCatName = 'Rudolph'; var secondCatPoints = 0; var runGame = function (quantity, firstPlayerName, firstPlayerPoints, secondPlayerName, secondPlayerPoints) { console.log(muffin.throwDice(quantity, quantity * 6)); }; runGame(diceNumber, firstCatName, firstCatPoints, secondCatName, secondCatPoints);

Thanks! We’ll fix everything at once!

Result

  1. Inside runGame, replace roll’s console log with increase of the points of the first player firstPlayerPoints += muffin.throwDice(quantity, quantity * 6);.
  2. Similarly, increase the second player’s points secondPlayerPoints.
  3. Log points of the first player firstPlayerName + 'rolled' + firstPlayerPoints in the console.
  4. Similarly, log the second player’s points.