For the second project, each team needs to program the card game “Midnight Baseball”. Each member of the team MUST program two user-defined functions. These user-defined functions will be graded as individual work.
Instruction for the game:
Midnight baseball is a unique variant of poker that is based on five card stud. Each player is dealt seven cards each, face down. The player is not allowed to look at the dealt cards hence the name, midnight. The game starts with the first person revealing just one of his cards. Then there is a round of betting. The next player, going clockwise around the table, then flips over his cards, one at a time, until he reveals a hand that beats the person to his right. Another round of betting is initiated by the person with the highest revealed hand. The next person now reveals his cards and the process continues until everybody’s cards are revealed. The person with the highest 5-card poker hand, remaining in the game, wins. When a player is revealing his cards and cannot beat the previous player’s hand, that person is eliminated from the game.
This game is called ‘baseball’ because of the uniqueness of 3’s 9’s and 4’s, which are important numbers in baseball. 3’s and 9’s are considered wildcards during the game. If a person reveals one of these cards, he can declare that wildcard to be whichever card he wishes to enhance his hand. If a person reveals a 4, he can decide whether or not to buy an additional card from the deck or remaining cards. The card is dealt to his face up or face down, it is the buyer’s decision. The price of the new card is determined before the game begins.
Rules for Betting: The player with the highest revealed cards initiates the betting. He can either bet or pass. If he bets, everyone in the game has to match his bet or fold. If you decide to fold, you are out of the game. A player also has the option of not only matching the bet, but raising it, in which case everyone would have to match that.
Number of players: 4 players
Teams for the Project: You will be working in groups of 4 students.
Individual functions: Each student must pick two functions to program in Matlab; for each team, each team member must program 2 different functions. Some potential functions (the team must decide which functions are needed):
a) Program 8 among these possible winning combinations (you don’t have to program all 10 conditions)
Royal Straight Flush Straight Straight flush Three of a kind Four of a kind Two pair Full house One pair Flush High card
b) Create deck of cards and distribute cards among all 4 players c) Win /Lose condition d) Point system e) Function that incorporates all other functions and play the game
Deliverables for the Project:
Deliverables Percent Deadline Note Matlab Code,
5% April 11 Each student must submit his/her own individual function. eCampus submission only.
Matlab Code, Group
25% April 23 The final code must incorporate all individual functions. One submission per team; hardcopy on eCampus (no softcopy needed)
40% April 20th Hardcopy in class and electronic copy uploaded to eCampus.
Peer Review 10% April 27th Format for the peer review will be discussed in class.
20% April 23rd Oral presentations will be done during class time.
*Note: If you are found to be a non-participating member of your group, I reserve the right to make you a group of one at any time