- 3.4k
- 8
- 19
I think everyone is familiar with the game of darts. For those that don't understand the scores, here here is a useful link.
The board
A dartboard can be compared to a pie cut in 20 pieces.
Each piece is divided in 4 sections.
- a small outer ring called "double" (points x2)
- a big ring called "single" (points x1)
- another small ring called "triple" (points x3)
- another big ring called "single" (points x1)
In the middle of the board are 2 more rings, a green one and red one (classic board)
- Red ring, at the center of the board, is called "bullseye" or "double bull" and is good for 50 points. This one counts as a double and because of that it's allowed to checkout with it.
- Green ring is called "bull", "single bull", or simply "25" and counts as a single.
Challenge
Find all checkout possibilities with 3 darts or less.
The user can enter an integer and you will have to check if it's possible to get the score to 0 with 3 darts (or fewer).
Examples
example 1:
Input: 170
Output: T20, T20, Bullseye
Example 2:
Input: 6
Output: D3;
S3,S1,D1;
S2,D2;
S2,S2,D1;
D2,D1;
S4,D1;
D1,D1,D1;
S1,S1,D2;
T1,S1,D1;
Example 3:
Input: 169
Output: No possible checkout!
Rules
- Basic dart rules, you must end with a double (outer ring of the board or bullseye)
- No use of external resources.
- Hard coding of possible checkouts is allowed, but remember, this is codegolf, it won't get your code short ;)
- Cells to hit will be displayed in format C+N where C = T for Triple, D for double and S for single.
- bullseye can be called bullseye or DB, DBull or something similar.
Possible checkouts
To get you started, the highest possible checkout is 170.
169, 168, 166, 165, 163, 162, and 159 are not possible in 3 darts.
The lowest possible checkout is 2.
In addition
This isn't a requirement: add in a possibility to show all possible checkouts for all scores. Basically because I wonder how many combinations are possible :P
Winner will be the one with the shortest code.
Happy coding.
I think everyone is familiar with the game of darts. For those that don't understand the scores, here is a useful link.
The board
A dartboard can be compared to a pie cut in 20 pieces.
Each piece is divided in 4 sections.
- a small outer ring called "double" (points x2)
- a big ring called "single" (points x1)
- another small ring called "triple" (points x3)
- another big ring called "single" (points x1)
In the middle of the board are 2 more rings, a green one and red one (classic board)
- Red ring, at the center of the board, is called "bullseye" or "double bull" and is good for 50 points. This one counts as a double and because of that it's allowed to checkout with it.
- Green ring is called "bull", "single bull", or simply "25" and counts as a single.
Challenge
Find all checkout possibilities with 3 darts or less.
The user can enter an integer and you will have to check if it's possible to get the score to 0 with 3 darts (or fewer).
Examples
example 1:
Input: 170
Output: T20, T20, Bullseye
Example 2:
Input: 6
Output: D3;
S3,S1,D1;
S2,D2;
S2,S2,D1;
D2,D1;
S4,D1;
D1,D1,D1;
S1,S1,D2;
T1,S1,D1;
Example 3:
Input: 169
Output: No possible checkout!
Rules
- Basic dart rules, you must end with a double (outer ring of the board or bullseye)
- No use of external resources.
- Hard coding of possible checkouts is allowed, but remember, this is codegolf, it won't get your code short ;)
- Cells to hit will be displayed in format C+N where C = T for Triple, D for double and S for single.
- bullseye can be called bullseye or DB, DBull or something similar.
Possible checkouts
To get you started, the highest possible checkout is 170.
169, 168, 166, 165, 163, 162, and 159 are not possible in 3 darts.
The lowest possible checkout is 2.
In addition
This isn't a requirement: add in a possibility to show all possible checkouts for all scores. Basically because I wonder how many combinations are possible :P
Winner will be the one with the shortest code.
Happy coding.
I think everyone is familiar with the game of darts. For those that don't understand the scores, here is a useful link.
The board
A dartboard can be compared to a pie cut in 20 pieces.
Each piece is divided in 4 sections.
- a small outer ring called "double" (points x2)
- a big ring called "single" (points x1)
- another small ring called "triple" (points x3)
- another big ring called "single" (points x1)
In the middle of the board are 2 more rings, a green one and red one (classic board)
- Red ring, at the center of the board, is called "bullseye" or "double bull" and is good for 50 points. This one counts as a double and because of that it's allowed to checkout with it.
- Green ring is called "bull", "single bull", or simply "25" and counts as a single.
Challenge
Find all checkout possibilities with 3 darts or less.
The user can enter an integer and you will have to check if it's possible to get the score to 0 with 3 darts (or fewer).
Examples
example 1:
Input: 170
Output: T20, T20, Bullseye
Example 2:
Input: 6
Output: D3;
S3,S1,D1;
S2,D2;
S2,S2,D1;
D2,D1;
S4,D1;
D1,D1,D1;
S1,S1,D2;
T1,S1,D1;
Example 3:
Input: 169
Output: No possible checkout!
Rules
- Basic dart rules, you must end with a double (outer ring of the board or bullseye)
- No use of external resources.
- Hard coding of possible checkouts is allowed, but remember, this is codegolf, it won't get your code short ;)
- Cells to hit will be displayed in format C+N where C = T for Triple, D for double and S for single.
- bullseye can be called bullseye or DB, DBull or something similar.
Possible checkouts
To get you started, the highest possible checkout is 170.
169, 168, 166, 165, 163, 162, and 159 are not possible in 3 darts.
The lowest possible checkout is 2.
In addition
This isn't a requirement: add in a possibility to show all possible checkouts for all scores. Basically because I wonder how many combinations are possible :P
Winner will be the one with the shortest code.
Happy coding.
- 50.9k
- 11
- 133
- 364
I think everyone is familiar with the game of darts, some people dont. For those that don't understand the scores so for those people, here is a usefulluseful link on that.
The board
###The board
AA dartboard can be compared to a pie cut in 20 pieces.
Each piece is divided in 4 sections.
- a small outer ring called double"double" (points x2)
- a big ring called single"single" (points x1)
- another small ring called triple"triple" (points x3)
- another big ring called single"single" (points x1)
In the middle of the board are 2 more rings, a green one and red one (classic board)
- Red ring, at the center of the board, is called bullseye"bullseye" or double bull"double bull" and is good for 50 points. This one counts as a double andand because of that itsit's allowed to checkout with it.
- Green ring, is called bull"bull", single bull"single bull", or simply 25"25" and counts as a single.
Challenge
###Challenge
FindFind all checkout possibiltiespossibilities with 3 darts or less.
The user can enter an integer and you will have to check if itsit's possible to get the score to 0 with 3 darts (or fewer).
Examples
###Examples exampleexample 1:
Input: 170
Output: T20, T20, Bullseye
Example 2:
Input: 6
Output: D3;
S3,S1,D1;
S2,D2;
S2,S2,D1;
D2,D1;
S4,D1;
D1,D1,D1;
S1,S1,D2;
T1,S1,D1;
Example 3:
Input: 169
Output: No possible checkout!
###Rules
Rules
- Basic dart rulerules, you must end with a double (outer ring of the board or bullseye)
- No use of external resources.
- Hard coding of possible checkouts is allowed, but remember, this is codegolf, it wontwon't get your code short ;)
- Cells to hit will be displayed in format C+N where C = T for Triple, D for double and S for single.
- bullseye can be called bullseye or DB, DBull or something simularsimilar.
Possible checkouts
###Possible checkouts
ToTo get you started, Thethe highest possible checkout is 170.
169,168 168,166 166,165 165,163 163,162 162,159 and 159 are not possible in 3 darts.
The lowest possible checkout is 2.
In addition
###In addition This isntThis isn't a requirement,: add in a possibility to show all possible checkouts for all scores. Basicly Basically because I wonder how many combinations are possible :P
Winner will be the one with the shortest code.
Happy coding.
I think everyone is familiar with darts, some people dont understand the scores so for those people here is a usefull link on that.
###The board A dartboard can be compared to a pie cut in 20 pieces. Each piece is divided in 4 sections.
- a small outer ring called double (points x2)
- a big ring called single (points x1)
- another small ring called triple (points x3)
- another big ring called single (points x1)
In the middle of the board are 2 more rings, a green and red one (classic board)
- Red ring, center of the board called bullseye or double bull and is good for 50 points. This one counts as a double and because of that its allowed to checkout with it.
- Green ring, called bull, single bull or simply 25 and counts as a single.
###Challenge
Find all checkout possibilties with 3 darts or less.
The user can enter an integer and you will have to check if its possible to get the score to 0 with 3 darts (or fewer).
###Examples example 1:
Input: 170
Output: T20, T20, Bullseye
Example 2:
Input: 6
Output: D3;
S3,S1,D1;
S2,D2;
S2,S2,D1;
D2,D1;
S4,D1;
D1,D1,D1;
S1,S1,D2;
T1,S1,D1;
Example 3:
Input: 169
Output: No possible checkout!
###Rules
- Basic dart rule, you must end with a double (outer ring of the board or bullseye)
- No use of external resources.
- Hard coding of possible checkouts is allowed but remember this is codegolf, it wont get your code short ;)
- Cells to hit will be displayed in format C+N where C = T for Triple, D for double and S for single.
- bullseye can be called bullseye or DB, DBull or something simular.
###Possible checkouts
To get you started, The highest possible checkout is 170.
169,168,166,165,163,162,159 are not possible in 3 darts.
The lowest possible checkout is 2.
###In addition This isnt a requirement, add in a possibility to show all possible checkouts for all scores. Basicly because I wonder how many combinations are possible :P
Winner will be the one with the shortest code.
Happy coding.
I think everyone is familiar with the game of darts. For those that don't understand the scores, here is a useful link.
The board
A dartboard can be compared to a pie cut in 20 pieces.
Each piece is divided in 4 sections.
- a small outer ring called "double" (points x2)
- a big ring called "single" (points x1)
- another small ring called "triple" (points x3)
- another big ring called "single" (points x1)
In the middle of the board are 2 more rings, a green one and red one (classic board)
- Red ring, at the center of the board, is called "bullseye" or "double bull" and is good for 50 points. This one counts as a double and because of that it's allowed to checkout with it.
- Green ring is called "bull", "single bull", or simply "25" and counts as a single.
Challenge
Find all checkout possibilities with 3 darts or less.
The user can enter an integer and you will have to check if it's possible to get the score to 0 with 3 darts (or fewer).
Examples
example 1:
Input: 170
Output: T20, T20, Bullseye
Example 2:
Input: 6
Output: D3;
S3,S1,D1;
S2,D2;
S2,S2,D1;
D2,D1;
S4,D1;
D1,D1,D1;
S1,S1,D2;
T1,S1,D1;
Example 3:
Input: 169
Output: No possible checkout!
Rules
- Basic dart rules, you must end with a double (outer ring of the board or bullseye)
- No use of external resources.
- Hard coding of possible checkouts is allowed, but remember, this is codegolf, it won't get your code short ;)
- Cells to hit will be displayed in format C+N where C = T for Triple, D for double and S for single.
- bullseye can be called bullseye or DB, DBull or something similar.
Possible checkouts
To get you started, the highest possible checkout is 170.
169, 168, 166, 165, 163, 162, and 159 are not possible in 3 darts.
The lowest possible checkout is 2.
In addition
This isn't a requirement: add in a possibility to show all possible checkouts for all scores. Basically because I wonder how many combinations are possible :P
Winner will be the one with the shortest code.
Happy coding.
- 2.9k
- 1
- 19
- 22