Skip to content

Instantly share code, notes, and snippets.

@Cst2989
Last active October 25, 2021 07:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Cst2989/88d807e352b61689e08087e96582dc98 to your computer and use it in GitHub Desktop.
Save Cst2989/88d807e352b61689e08087e96582dc98 to your computer and use it in GitHub Desktop.
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