mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2025-12-12 12:22:12 +00:00
Revert undesired changes to the README.
Signed-off-by: Lennart Fridén <lennart@devl.se>
This commit is contained in:
parent
24d532ed94
commit
64b5914afa
@ -30,7 +30,7 @@ with the category, the player scores zero for the roll.
|
|||||||
For example, suppose a player scores 5,6,5,5,2 in the fives
|
For example, suppose a player scores 5,6,5,5,2 in the fives
|
||||||
category they would score 15 (three fives). The score for
|
category they would score 15 (three fives). The score for
|
||||||
that go is then added to their total and the category cannot
|
that go is then added to their total and the category cannot
|
||||||
be used again in the remaining goes for that game.
|
be used again in the remaining goes for that game.
|
||||||
A full game consists of one go for each category. Thus, for
|
A full game consists of one go for each category. Thus, for
|
||||||
their last go in a game, a player must choose their only
|
their last go in a game, a player must choose their only
|
||||||
remaining category.
|
remaining category.
|
||||||
@ -39,78 +39,78 @@ Your task is to score a GIVEN roll in a GIVEN category.
|
|||||||
You do NOT have to program the random dice rolling.
|
You do NOT have to program the random dice rolling.
|
||||||
The game is NOT played by letting the computer choose the
|
The game is NOT played by letting the computer choose the
|
||||||
highest scoring category for a given roll.
|
highest scoring category for a given roll.
|
||||||
|
|
||||||
|
|
||||||
## Kata: Yahzee Categories and Scoring Rules
|
## Kata: Yahzee Categories and Scoring Rules
|
||||||
|
|
||||||
_Note these rules differ from the original (copyrighted) rules_
|
_Note these rules differ from the original (copyrighted) rules_
|
||||||
|
|
||||||
Chance:
|
Chance:
|
||||||
The player scores the sum of all dice,
|
The player scores the sum of all dice,
|
||||||
no matter what they read.
|
no matter what they read.
|
||||||
For example,
|
For example,
|
||||||
1,1,3,3,6 placed on "chance" scores 14 (1+1+3+3+6)
|
1,1,3,3,6 placed on "chance" scores 14 (1+1+3+3+6)
|
||||||
4,5,5,6,1 placed on "chance" scores 21 (4+5+5+6+1)
|
4,5,5,6,1 placed on "chance" scores 21 (4+5+5+6+1)
|
||||||
|
|
||||||
Yahtzee:
|
Yahtzee:
|
||||||
If all dice have the same number,
|
If all dice have the same number,
|
||||||
the player scores 50 points.
|
the player scores 50 points.
|
||||||
For example,
|
For example,
|
||||||
1,1,1,1,1 placed on "yahtzee" scores 50
|
1,1,1,1,1 placed on "yahtzee" scores 50
|
||||||
1,1,1,2,1 placed on "yahtzee" scores 0
|
1,1,1,2,1 placed on "yahtzee" scores 0
|
||||||
|
|
||||||
Ones, Twos, Threes, Fours, Fives, Sixes:
|
Ones, Twos, Threes, Fours, Fives, Sixes:
|
||||||
The player scores the sum of the dice that reads one,
|
The player scores the sum of the dice that reads one,
|
||||||
two, three, four, five or six, respectively.
|
two, three, four, five or six, respectively.
|
||||||
For example,
|
For example,
|
||||||
1,1,2,4,4 placed on "fours" scores 8 (4+4)
|
1,1,2,4,4 placed on "fours" scores 8 (4+4)
|
||||||
2,3,2,5,1 placed on "twos" scores 4 (2+2)
|
2,3,2,5,1 placed on "twos" scores 4 (2+2)
|
||||||
3,3,3,4,5 placed on "ones" scores 0
|
3,3,3,4,5 placed on "ones" scores 0
|
||||||
|
|
||||||
Pair:
|
Pair:
|
||||||
The player scores the sum of the two highest matching dice.
|
The player scores the sum of the two highest matching dice.
|
||||||
For example, when placed on "pair"
|
For example, when placed on "pair"
|
||||||
3,3,3,4,4 scores 8 (4+4)
|
3,3,3,4,4 scores 8 (4+4)
|
||||||
1,1,6,2,6 scores 12 (6+6)
|
1,1,6,2,6 scores 12 (6+6)
|
||||||
3,3,3,4,1 scores 0
|
3,3,3,4,1 scores 0
|
||||||
3,3,3,3,1 scores 0
|
3,3,3,3,1 scores 0
|
||||||
|
|
||||||
Two pairs:
|
Two pairs:
|
||||||
If there are two pairs of dice with the same number, the
|
If there are two pairs of dice with the same number, the
|
||||||
player scores the sum of these dice.
|
player scores the sum of these dice.
|
||||||
For example, when placed on "two pairs"
|
For example, when placed on "two pairs"
|
||||||
1,1,2,3,3 scores 8 (1+1+3+3)
|
1,1,2,3,3 scores 8 (1+1+3+3)
|
||||||
1,1,2,3,4 scores 0
|
1,1,2,3,4 scores 0
|
||||||
1,1,2,2,2 scores 0
|
1,1,2,2,2 scores 0
|
||||||
|
|
||||||
Three of a kind:
|
Three of a kind:
|
||||||
If there are three dice with the same number, the player
|
If there are three dice with the same number, the player
|
||||||
scores the sum of these dice.
|
scores the sum of these dice.
|
||||||
For example, when placed on "three of a kind"
|
For example, when placed on "three of a kind"
|
||||||
3,3,3,4,5 scores 9 (3+3+3)
|
3,3,3,4,5 scores 9 (3+3+3)
|
||||||
3,3,4,5,6 scores 0
|
3,3,4,5,6 scores 0
|
||||||
3,3,3,3,1 scores 0
|
3,3,3,3,1 scores 0
|
||||||
|
|
||||||
Four of a kind:
|
Four of a kind:
|
||||||
If there are four dice with the same number, the player
|
If there are four dice with the same number, the player
|
||||||
scores the sum of these dice.
|
scores the sum of these dice.
|
||||||
For example, when placed on "four of a kind"
|
For example, when placed on "four of a kind"
|
||||||
2,2,2,2,5 scores 8 (2+2+2+2)
|
2,2,2,2,5 scores 8 (2+2+2+2)
|
||||||
2,2,2,5,5 scores 0
|
2,2,2,5,5 scores 0
|
||||||
2,2,2,2,2 scores 0
|
2,2,2,2,2 scores 0
|
||||||
|
|
||||||
Small straight:
|
Small straight:
|
||||||
When placed on "small straight", if the dice read
|
When placed on "small straight", if the dice read
|
||||||
1,2,3,4,5, the player scores 15 (the sum of all the dice.
|
1,2,3,4,5, the player scores 15 (the sum of all the dice.
|
||||||
|
|
||||||
Large straight:
|
Large straight:
|
||||||
When placed on "large straight", if the dice read
|
When placed on "large straight", if the dice read
|
||||||
2,3,4,5,6, the player scores 20 (the sum of all the dice).
|
2,3,4,5,6, the player scores 20 (the sum of all the dice).
|
||||||
|
|
||||||
Full house:
|
Full house:
|
||||||
If the dice are two of a kind and three of a kind, the
|
If the dice are two of a kind and three of a kind, the
|
||||||
player scores the sum of all the dice.
|
player scores the sum of all the dice.
|
||||||
For example, when placed on "full house"
|
For example, when placed on "full house"
|
||||||
1,1,2,2,2 scores 8 (1+1+2+2+2)
|
1,1,2,2,2 scores 8 (1+1+2+2+2)
|
||||||
2,2,3,3,4 scores 0
|
2,2,3,3,4 scores 0
|
||||||
4,4,4,4,4 scores 0
|
4,4,4,4,4 scores 0
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user