- script.js
JavaScript
let diceNumber = 2;
let firstCatName = 'Cupcake';
let firstCatPoints = 0;
let secondCatName = 'Rodolfo';
let secondCatPoints = 0;
let runGame = function (quantity, firstPlayerName, firstPlayerPoints, secondPlayerName, secondPlayerPoints) {
firstPlayerPoints += keks.throwDice(quantity, quantity * 6);
secondPlayerPoints += keks.throwDice(quantity, quantity * 6);
console.log(firstPlayerName + ' sacó ' + firstPlayerPoints);
console.log(secondPlayerName + ' sacó ' + secondPlayerPoints);
};
runGame(diceNumber, firstCatName, firstCatPoints, secondCatName, secondCatPoints);
Resultado de la ejecución
ObjetivosRealizado
0
- Antes de
runGame, agrega el objeto del primer participante:firstCat. - Agrega a
firstCatuna propiedad para el nombre: clavename, valor'Cupcake'. - Después de
firstCat, agrega el objetosecondCatcon el nombre'Rodolfo'. - Agrega a cada objeto una propiedad para los puntos: clave
points, valor0.