Program 2: Three Card Poker
Logistics
note: This input file will be used for testing.
Logistics
- Due Date:
- To solve this problem, you need to understand the following new Python concepts: lists, files.
- A three-card poker hand consists of any three cards from a standard 52-card deck. For a single card, there are 13 possible ranks (two, three, four, five, six, seven, eight, nine, ten, jack, queen, king, ace) and 4 possible suits (clubs, diamonds, hearts, spades).
- A Flush occurs when all cards have the same suit.
- Three of a Kind occurs when all cards have the same rank.
- Two of a Kind occurs when two of the three cards have the same rank.
- If none of the above three situations applies, the hand is worth Nothing.
- Download poker.py and modify it so that when it is run on this input file, it produces this output file.
- The input file contains an unknown number of poker hands. Each line contains a three card poker hand in this format: Card 1 Rank, Card 1 Suit, Card 2 Rank, Card 2 Suit, Card 3 Rank, Card 3 Suit.
- All poker hands are valid and use only lowercase letters.
note: This input file will be used for testing.
- 10 points - Every Flush is identified correctly.
- 10 points - Every Three of a Kind is identified correctly.
- 10 points - Every Two of a Kind is identified correctly.
- 10 points - Every Nothing is identified correctly.
- 10 points - At least three of the following boolean functions exist and are used correctly in the solution: flush, three_of_a_kind, two_of_a_kind and nothing.
- 15 points - The format of the output file matches the format of the sample output file above exactly. (3 points for each type of difference up to 15 points.)
- 15 points - The Python solution is properly commented, easy to understand and does not contain unnecessary code. (3 points for each type of improvement up to 15 points.)
- 20 points - All output appears in the correct output file (15 points) and no output appears in the Python shell (5 points).