Skip to content
Open

push #36

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
}

}

Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}