You are required to design and implement a program that allows the user to play a single-player dice game based loosely on the game “Farkle” (although you do not need to be familiar with Farkle). The game is played as follows:
· The game consists of
3 turns, and the aim of the game is to
score as many points as possible
· Each turn begins with a
roll of 6 standard dice
·
Matching dice
(2 or more of the same number)
can be set aside for points, and the
remaining dice can then be re-rolled
in an attempt to score more points
§ Points are “amount of dice * number on dice”, e.g. rolling three 5s is worth 15 points
· Theplayer
chooseswhetherto set matching dice aside and whether to re-roll remaining dice
· If the player
chooses not to re-roll the dice, the
points accumulated in the turn are added to their score and the turn ends
· If
no dice can be put aside after a roll, the player
loses the points the potential points and the turn ends
– hence, the player must decide how far to push their luck with additional rolls
The game involves quite a lot of luck, but there is also a small amount of strategy in choosing whether to set matching dice aside and whether to re-roll the remaining dice.
The entirety of this program can be implemented in under 100 lines of code