From 842203f5ac382befa49e9ea5876aa1cca4b1c817 Mon Sep 17 00:00:00 2001 From: brookecowey Date: Fri, 7 Apr 2023 11:08:46 -0500 Subject: [PATCH] push --- main.js | 31 +++++++++++++++++++++++++++++-- package.json | 12 ++++++------ 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/main.js b/main.js index e98b0914..4b8b0503 100644 --- a/main.js +++ b/main.js @@ -14,8 +14,35 @@ const rl = readline.createInterface({ // the function that will be called by the unit test below const rockPaperScissors = (hand1, hand2) => { - // Write code here - // Use the unit test to see what is expected +hand1 = hand1.toLowerCase().trim() +hand2 = hand2.toLowerCase().trim() + + +//tie +if(hand1 == hand2) +{ + +return "It's a tie!" + +} + +//hand 1 wins + +if( +(hand1 == "paper" && hand2 == "rock") || +(hand1 == "scissors" && hand2 == "paper") || +(hand1 == "rock" && hand2 == "scissors") +) +{ + return "Hand one wins!" +} + +//hand 2 wins + +else + { + return "Hand two wins!" + } } diff --git a/package.json b/package.json index 09c5e8f1..ead6c908 100644 --- a/package.json +++ b/package.json @@ -19,14 +19,14 @@ }, "homepage": "https://github.com/AustinCodingAcademy/JS211_RockPaperScissorsProject#readme", "dependencies": { - "eslint": "^3.19.0", - "functional-javascript-workshop": "^1.0.6", + "eslint": "^8.37.0", + "functional-javascript-workshop": "^0.0.23", "htmllint-cli": "github:kevincolten/htmllint-cli", - "http-server": "^0.11.1", - "javascripting": "^2.6.1", - "jsdom": "^11.6.2", + "http-server": "^14.1.1", + "javascripting": "^2.4.0", + "jsdom": "^21.1.1", "mocha": "^5.0.0", "postcss-html": "^0.34.0", - "stylelint": "^7.13.0" + "stylelint": "^15.3.0" } }