Homework #3: Python

Due: Tuesday, February 7, 2006

You are to write a object-oriented Python program that allows a user to play a video poker game that uses dice. The base set of rules is as follows:

Hand Example Payout
Two Pairs 4, 4, 3, 6, 6 $ 5
Three of a Kind 2, 4, 1, 1, 1 $ 8
Full House (a pair and a three of a kind) 3, 5, 5, 5, 3 $ 12
Four of a Kind 3, 3, 3, 3, 6 $ 15
Straight (1-5 or 2-6) 5, 2, 3, 1, 4 $ 20
Five of a Kind 3, 3, 3, 3, 3 $ 30

Welcome to video poker!

Do you wish to try your luck? y

You currently have $90.

Roll 1 Dice: [6, 4, 4, 2, 4]

Positions: 1 2 3 4 5

Enter the positions of the dice you want to reroll (or Enter to stop): 1 4

Roll 2 Dice: [3, 4, 4, 4, 4]

Positions: 1 2 3 4 5

Enter the positions of the dice you want to reroll (or Enter to stop): 1

Roll 3 Dice: [2, 4, 4, 4, 4]

Four of a Kind. You win $15!

You currently have $105.

Do you wish to try your luck? y

. . .

Extra Credit: Read about and implement a GUI interface to this video poker game.

You are to hand in: