Last active
October 25, 2021 07:59
-
-
Save Cst2989/88d807e352b61689e08087e96582dc98 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
export const calculateFrame = (rollOne, rollTwo) => { | |
const score = rollOne + rollTwo; | |
if (score > 10) { | |
return 'Invalid frame input'; | |
} | |
if (rollOne === 10) { | |
return 'X'; | |
} | |
return score === 10 ? '/' : score; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment