...

/

Get the Number of Rounds

Get the Number of Rounds

Learn how to specify the number of rounds.

What have we got?

We have set up a function to print the introduction of the game. This is our inventory of already created functions:

// Function to display game instructions
function displayInstructions(){
console.log('Welcome to Rock Paper Scissors.\n');
console.log('The rules are simple:');
console.log('1. Rock beats scissors');
console.log('2. Scissors beat paper');
console.log('3. Paper beats rock');
}
// Function to contain the flow of the whole program
function main(){
displayInstructions();
// Call for the function that takes input and storing its output
const rounds = getRounds();
}
Inventory of created functions

The next step is to ask the user about the number ...