Skip to content

Commit

Permalink
Adicionando condição de empate
Browse files Browse the repository at this point in the history
  • Loading branch information
jaovitu committed Aug 23, 2022
1 parent c6ec733 commit ed82644
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ app.post('/message', (request, response) => {

const botChoice = options[ Math.floor( Math.random() * options.length ) ];

if (botChoice === userChoice.toLowerCase()) {
return response.send('<Response><Message>Ops! Parece que empatamos...</Message></Response>');
}

const isUserWinner = wins[userChoice.toLowerCase()] === botChoice;

if (!isUserWinner) {
Expand Down

0 comments on commit ed82644

Please sign in to comment.