Csc10002 - Programming Techniques Midterm Project - Pointers
Csc10002 - Programming Techniques Midterm Project - Pointers
I Project Content
I.1 Card shuffling & Dealing
Consider a standard deck of 52 cards, each of which is characterized by
1
Figure 1: The matrix deck stores the shuffled cards.
• Prints out the card following their orders (from 1 to 52), each of
which is characterized by its (suit, f ace). For example,
(Hearts, F our)
(Clubs, Eight)
(Clubs, F our)
• The second player receives the [2, 6, 10, 14, 18] cards,
• The third player receives the [3, 7, 11, 15, 19] cards, and
• The fourth player receives the [4, 8, 12, 16, 20] cards.
(i) Straight flush: a hand that contains five cards of sequential rank, all of the
same suits
(ii) Four of a kind or quads: a hand that contains four cards of one rank and
one card of another rank
(iii) Full house: a hand that contains three cards of one rank and two cards of
another rank
2
(iv) Flush: a hand that contains five cards all of the same suit, not all of
sequential rank
(v) Straight: a hand that contains five cards of sequential rank, not all of the
same suit
(vi) Three of a kind : a hand that contains three cards of one rank and two
cards of two other ranks
(vii) Two pairs: a hand that contains two cards of one rank, two cards of
another rank and one card of a third rank
(viii) Pair : a hand that contains two cards of one rank and three cards of three
other ranks
(ix) None of the above categories: the highest card is taken as a representative.
The player whose hand contains five higher cards wins. If two players fall into
the same category (e.g., two pairs), it is a tie.
1. Write a poker game for one player only. You may need to implement the
following functions:
3
h) A function that checks whether a hand contains Straight flush
int isStraightFlush(int** hand)
i) A function that checks whether a hand contains Three of a kind
int isThreeOfAKind(int** hand)
j) A function that checks whether a hand contains Two pairs
int isTwoPairs(int** hand)
k) A function that checks whether a hand contains Pair
int isPair(int** hand)
l) A function that returns the value of the highest card
int getHighestCard(int** hand)
2. Write a poker game for 2 players (you may want to extend for n players,
n > 2). You may need to implement the following functions.
3.∗ Write a poker game for dealer side. The dealer also receives five cards,
yet he may additionally draw one, two or three cards to replace some old
cards (new cards are continuously drawn from the current deck).
The replacement of one, two, or three cards from the set of five cards can
be decided following (1) random replacement or (2) replace to get better
situation.
4.∗∗∗ Write a program that lets a player and the dealer compete with each
other. The player may decide whether to additionally draw one, two or
three cards or not.
5.∗∗∗∗ Replace the decision making algorithm of the dealer to have different
game levels (easy, medium and hard)
4
II Regulations
• Your file submission must be named Student1’s ID_Student2’s ID.rar(.zip)
which is compressed from the Student1’s ID_Student2’s ID folder.
This folder includes:
– The Report.pdf file. You can see the requirement contents of this
file in the section below.
– The finished Checklist.xlsx file.
– Source sub-folder that contains your source code (*.cpp, *.h). Any
other extensions submission must be declared and explained in your
report.
• Plagiarism and Cheating will result in an "0" (zero) for the entire course
and will be subject to appropriate referral to the Management Board of
High-Quality Program for further action.
III Evaluation
The project will be graded on your source code and report.
• Build a user menu for the features from II.1 and II.2 (10 pts)
• The report must be presented clearly and logically. The length of your
report must not exceed 10 A4 pages.
• Compulsory contents:
5
References
P.J. Deitel and H.M. Deitel. C how to Program: With an Introduction to C++.
How to program series. Pearson, 2015. ISBN 9781292111087.