Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created August 8, 2020 09:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codecademydev/03e90d69998f67a4f3ebd9934862320b to your computer and use it in GitHub Desktop.
Save codecademydev/03e90d69998f67a4f3ebd9934862320b to your computer and use it in GitHub Desktop.
Codecademy export
const getUserChoice = userInput => {
userInput = userInput.toLowerCase();
if(userInput === 'rock' || userInput === 'paper' || userInput === 'sciccors') {
return userInput;
} else {
console.log('Error!')
}};
const getComputerChoice = () => {
const randomNumber = Math.floor(Math.random() * 3);
}
switch (randomNumber) {
case 0:
return 'rock';
case 1:
return 'paper';
case 2:
return 'scissors';
}
console.log(getComputerChoice());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment