Rock, Paper, Scissors
Folow the steps to finish the game. Some parts have been started for you.
Remember "//" is a comment in the code and will do nothing
When you see "//todo:" in the code, you need to add more code
- Ask the user for thier choice
var usersChoice = prompt("Do you choose rock, paper or scissors?");
- Get a random computer choice by calling the GetRandomChoice() function and saving it to the "computerChoice" variable.
var computerChoice = GetRandomChoice();
- Display the computer's choice. Remember to use the alert command.
alert("The computer chooses " + computerChoice);
- Find the winner and save the results as "results" using the GetResults() function.
var results = GetResults(usersChoice, computerChoice);
- Complete the GetResults() function. Only a few possible situations have been completed.
- Display the winner
alert(results);
- Run the game