forked from CoachJulian/2023TeamEdgeTerm0
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdebugger.js
25 lines (21 loc) · 830 Bytes
/
debugger.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
const READLINE = require("readline-sync");
const options = ["rock", "paper", "scissors"];
console.log(`Let's play Rock Paper Scissors!`);
// Challenge
// Find the bugs below:
while(true){
let userInput = READLINE.question(`Do you want to play rock, paper, or scissors? `).toLowerCase();
randomSelection = Math.floor(Math.random()*3);
computerSelection = options[randomSelection];
console.log("You played: ${userInput} and the computer played: ${computerSelection}");
if(userInput === computerSelection){
console.log("It's a tie!");
}
else if((userInput = "rock" && computerSelection = "paper") ||
(userInput = "paper" && computerSelection = "scissors") ||
(userInput = "scissors" && computerSelection = "rock")){
console.log("You Lose!");
}
else if{
console.log("You Win!");
}