- Yahtzee Dice Sort
- 18 Sep 2016 01:32:08 pm
- Last edited by RandomGuest on 19 Sep 2016 07:51:17 pm; edited 1 time in total
I have already seen Weregoose's routine on Yahtzee, but I have a different set of possibilities to sort.
Here they are:
(1) 5 of a kind (5K): Identical to a Yahtzee. (AAAAA)
(2) 4 of a kind (4K): 4 of a kind and one single (AAAAB)
(3) Full House (FH): 3 of a kind and a pair (AAABB)
(4) 3 of a kind (3K): 3 of a kind and two singles (AAABC)
(5) 2 pair (2P): 2 pairs and a single (AABBC)
(6) 1 pair (1P): One pair and 3 singles (AABCD)
(7) Chance (CH): 5 singles (ABCDE)
For example, a roll of {2,4,5,2,6} would be a pair. {3,4,5,4,3} would be two pair, etc.
The program should input a list of 5 numbers 1-6 and output the correct two-letter abbreviation. Source code should be in the post, with downloads optional.
Karma to the shortest program. (Extra karma if you can create a seperate program for all of the possibilities for 6 dice.)
Here they are:
(1) 5 of a kind (5K): Identical to a Yahtzee. (AAAAA)
(2) 4 of a kind (4K): 4 of a kind and one single (AAAAB)
(3) Full House (FH): 3 of a kind and a pair (AAABB)
(4) 3 of a kind (3K): 3 of a kind and two singles (AAABC)
(5) 2 pair (2P): 2 pairs and a single (AABBC)
(6) 1 pair (1P): One pair and 3 singles (AABCD)
(7) Chance (CH): 5 singles (ABCDE)
For example, a roll of {2,4,5,2,6} would be a pair. {3,4,5,4,3} would be two pair, etc.
The program should input a list of 5 numbers 1-6 and output the correct two-letter abbreviation. Source code should be in the post, with downloads optional.
Karma to the shortest program. (Extra karma if you can create a seperate program for all of the possibilities for 6 dice.)