Get the Number of Rounds
Learn how to specify the number of rounds.
We'll cover the following...
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 instructionsfunction 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 programfunction main(){displayInstructions();// Call for the function that takes input and storing its outputconst rounds = getRounds();}
Inventory of created functions
The next step is to ask the user about the number ...