Created
July 16, 2020 19:26
-
-
Save marshallmurphy/19360634a0fd0aa4958a244625d6ec73 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function diceGame(playerRolls, dealerRoll) { | |
let match = false | |
playerRolls.forEach((roll, index) => { | |
for (let i = index + 1; i < playerRolls.length; i++) { | |
if (roll + playerRolls[i] === dealerRoll) { | |
match = true | |
} | |
} | |
}); | |
return match; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment