- Community Pick
- Experts Exchange Approved
For each possible checkout score, how many checkouts are there and what are they?
Some checkouts are mathematically possible but clearly poor strategy; so I want to eliminate those and just return the list of professionally viable choices.
If this intrigues you and you'd like to give it a shot and explain your take on it, here's a forum.
First, a primer on the game of 501.
- You start with 501 points and you race to 0.
- Each turn you get to throw up to 3 darts. The "checkout" is the turn where you go to exactly 0. If you go below 0 your turn is dead and your score reverts to what it was at the beginning of your turn.
- One dart can score anywhere from 1 to 60 (triple 20), a Bull (the most inner circle of the dart board is worth 50 and is considered a double), the ring immediately around the Bull is worth 25 and is considered a single. Thus giving you a maximum possible score of 180 points in turn.
- An additional caveat to this game is you must throw a double with your last dart, so the maximum possible score in a checkout is 170 (Triple-20, Triple-20 and Bull). Similarly, the minimum score for a checkout is 2, you throw one dart for a Double-1. Strategically it's bad to leave yourself with a D1 throw because if you accidentally miss and leave yourself a score of 1, you can't win because you can't double to hit it.
2 and 3 are the only scores that require a D1, so I hardcoded them as special cases at the end and explicitly removed D1 from the calculations in the interesting part of the query.
So, that's the game, the tech challenge is...
Assuming 10gR2 or higher database and using only DUAL, list all possible checkouts by the following rules:
- Must double on final dart
- Must use fewest number of darts (3 3 D3 is not ok, D6 is better)
- Avoid D1 as last throw if possible
- Avoid obviously more difficult throws for the same score
...don't throw doubles when a single will do (D7 when a 14 is easier)
...don't throw triples when a single or double will do (T12 when D18 is easier)
- 3-dart checkouts must be arranged so first dart is higher scoring than second dart
- Double-25 is called a Bull
- Final dart does determine a distinct checkout. Thus (D19 Bull) is distinct from (Bull D19)
For presentation consistency...
- A single-dart is represented by N, DN, TN, 25 or Bull where N is 1-20, D meaning Double, T meaning Triple
- A multi-dart checkout consists of single darts concatenated in order of throws separated by a single space
This article started as a question but I got no takers, so the question was deleted after a month of inactivity; but I thought it was an interesting topic, so I'll try again as an article. This is probably a better forum anyway because I'm not really interested in a "solution"; I'm more interested in the conversation and trade of ideas.
Here is my best attempt so far.
Have fun!