From a5f49257299ea4b80e971053c6ae1be1614c628d Mon Sep 17 00:00:00 2001 From: Collin Betori Date: Fri, 11 Jan 2019 16:42:46 -0600 Subject: [PATCH] initial commit --- 01week/rockPaperScissors.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 }