Authors: Daniel Dills, Michael Ryan, Matt Santorsola, and Kassie Bradshaw
Create a command line version of the dice game Game of Greed by expanding your understanding of Python standard library.
LAB 06:
- Today is all about tackling the highest risk and/or highest priority features - scoring, dice rolling and banking of points.
- Define a
GameLogic
class ingame_of_greed/game_logic.py
file - Handle calculating score for dice roll
- Add
calculate_score
static method to GameLogic class - The input to
calculate_score
is a tuple of integers that represent a dice roll - The output from
calculate_score
is an integer representing the roll's score according to rules of game.
- Add
- Handle rolling dice
- Add
roll_dice
static method to GameLogic class - The input to
roll_dice
is an integer between 1 and 6 - The output of
roll_dice
is a tuple with random values between 1 and 6 - The length of tuple must match the argument given to
roll_dice
method
- Add
- Handle banking points
- Define a
Banker
class - Add a
shelf
instance method- Input to
shelf
is the amount of points (integer) to add to shelf -
shelf
should temporarily store unbanked points
- Input to
- Add a
bank
instance method-
bank
should add any points on the shelf to total and reset shelf to 0 -
bank
output should be the amount of points added to total from shelf
-
- Add a
clear_shelf
instance method-
clear_shelf
should remove all unbanked points
-
- Define a
- Define a
LAB 07: PR for this lab
- Application should implement all features from previous version
- App should simulate rolling between 1 and 6 dice
- App should allow user to set aside dice each roll
- App should allow "banking" current score or rolling again
- App should keep track of total score
- App should keep track of current round
- App should have automated tests to ensure proper operation
LAB 08: PR for this lab
The game should now be close to playable - for honest players at least. Let's shore up the core functionality of the game by allowing users to set aside scoring dice and continuing their turn. Then we'll handle cheaters and/or confused players who are skirting the rules.
- Application should implement features from versions 1 and 2
- Should handle setting aside scoring dice and continuing turn with remaining dice
- Should handle when cheating occurs
- Or just typos
- E.g. roll =
[1, 3, 5, 2]
and user selects1, 1, 1, 1, 1, 1
- Should allow user to continue rolling with 6 new dice when all dice have scored in current turn
- Handle zilch
- No points for round, and round is over
- If you have questions, refer to game rules, the online game or ask the client (aka the Instructor)
-
Credit to Davee Sok for calculate score function