Skip to content

Instantly share code, notes, and snippets.

@Cst2989
Last active October 23, 2021 10:11
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/e7d5d8d497f95713971a6388b5bbb70e to your computer and use it in GitHub Desktop.
Save Cst2989/e7d5d8d497f95713971a6388b5bbb70e to your computer and use it in GitHub Desktop.
strike
if (roundScore === 'X') {
// handle Strike
const futurePoint = frames[index + 2] ? frames[index + 2][0] : 10;
const nextPoint = frames[index + 1][1] || frames[index + 1][0] !== 10
? frames[index + 1][1]
: futurePoint;
if (nextPoint) {
roundScore = 10 + frames[index + 1][0] + nextPoint;
} else {
roundScore = 10 + frames[index + 1][0];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment