A simple simulation of the game 'Yahtzee'. For additional Information please refer to /doc.
The save file can be chosen with the following parameter:
python main.py -s "save_file"
If no file is provided, the game defaults to the file ./save.json.
The players names can be chosen with the following parameters:
python main.py -1 "player_name_one" -2 "player_name_two"
python main.py --player-one "player_name_one" --player-two "player_name_two"
If no name is provided, the names default to "Player 1, Player 2".
A simple "how-to-play" is printed in the screen when running the game.
One of the two players in randomly selected to go first. The player can then choose to roll up to 3 times, or end his turn early if he desires to do so. While rolling, individual dice can be stored, so they wont be rerolled.
When a player cannot roll anymore, he has to select a category he wants to collect points for. He then gets these points and the category cannot be selected again. An exception to this rule is the "yahtzee", as one can roll this perticular constellation multiple times.
The game is saved after every turn.
The game ends once both players have collected points for each category. The player with more points wins.
After ending a game the respective save file gets removed.
Key | Function |
---|---|
Numbers 1-5 | Store the dice with the respective number |
Space | Roll the dice |
Enter | End a turn early |
q | Exit the game early -> Will save the game! |