General Description
Street craps.& object-oriented programming.
Rules of game
(1) once rolls two dice
(2) First roll
- 2,3,12: LOSE
- 7,11: WIN
- others: maked as a “point”
(3) Later rolls
- “point”: WIN
- 7: LOSE
HINT
(1)die.py:
Class Die
Attribute: current-value
Method: roll() - randint(1,6)
(2)pair_of_dice.py:
Class PairOfDice
Attritube: two Die
Method: roll_dice(),
current_value(): return the sum of its Die object’s current values
(3)game_controler.py
Class: GameController
(4)dice_game.py
main()
QUESTION
如何实现:The die should have a current_value attribute that represents its current face-up value (i.e. the last value it was rolled).
: