Skip to content

Instantly share code, notes, and snippets.

@parhamr
Created October 15, 2013 19:05
Show Gist options
  • Save parhamr/6996954 to your computer and use it in GitHub Desktop.
Save parhamr/6996954 to your computer and use it in GitHub Desktop.
How to represent competitions in code

Given…

  1. Competitions of fixed time will be scored on a measurement criteria
  2. Competitions of fixed measurements will be scored on a time criteria

The criteria can be high score OR low score wins

Measurements are typically distance (miles, km, etc) or counts (arbitrary; pins in bowling, free throws in basketball, dollars in fundraising)

Override layers are needed for some conditions where special scoring is wanted. These can be tournaments, score handicaps, or even something playful like house rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment