Skip to content

Instantly share code, notes, and snippets.

@abyx
Created November 4, 2010 17:48
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 abyx/662853 to your computer and use it in GitHub Desktop.
Save abyx/662853 to your computer and use it in GitHub Desktop.
Bowling snippet with duplication?
if rolls[frameIndex] == 10:
score += rolls[frameIndex] + rolls[frameIndex + 1] + rolls[frameIndex + 2]
frameIndex++
elif rolls[frameIndex] + rolls[frameIndex + 1] == 10:
score += rolls[frameIndex] + rolls[frameIndex + 1] + rolls[frameIndex + 2]
frameIndex += 2
else:
score += rolls[frameIndex] + rolls[frameIndex + 1]
frameIndex += 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment