diff --git a/01week/rockPaperScissors.js b/01week/rockPaperScissors.js index 16f58790a..feaf9a34e 100644 --- a/01week/rockPaperScissors.js +++ b/01week/rockPaperScissors.js @@ -9,8 +9,16 @@ const rl = readline.createInterface({ function rockPaperScissors(hand1, hand2) { + + if (hand1 === hand2){ + "tie" + }else if((hand1 === 'rock' && hand2 === 'scissors') || (hand1 === 'paper' && hand2 === 'rock') || (hand1 === 'scissors' && hand2 === 'paper')){ + "Hand 1 wins" + }else{ + "Hand 2 wins" + }; + - // Write code here }