Skip to content

baimamboukar/card_game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CARD GAME USING OOP APPROACH WITH C++

ENTITIES OF THE GAME

Player

: The player is characterized by his name, number of wins, number of loses, high score and hand. He can change his hand of cards as many time as he wants until he is satisfied with the given hand of cards.

Card

: Each card is characterized by its name, worth and suit (from where the colour can also be deduced).

Deck

: the deck is the collection that contains all the 52 cards of the game. We can either pick a card inside the deck or a hand (set of 5 cards).

HOW THE GAME WORKS

This is how the game works (logically): o It requires a player (the user) and the computer. The game starts when the player is satisfied with the hand of 5 cards that have been randomly picked from the deck and given to him. o The user has the possibility to change the first 5 cards that have been given to him to a new hand that is taken from the deck. The computer’s cards are only displayed only once the player has made the choice to keep his cards (to avoid cheating). o Once both players have their hands ready, their hands are compared and the one with the highest total value of points is announced as the winner.

##DEMO ###MENU After running opening the game, this main interface will be displayed menu

###GAME RULES The user has the possibility to read the game rules before playing. If he chooses option 4, he/she will see this following interface how to play

###GALEERY The user can also view the gallery (deck) to understand the worth and suite of each cards with the option 5. gallery

###GAME If the player choses the first option, he will be greeted with an interface demanding his nickname. Once validated, the game starts. name

###CHANGING HAND when the game starts 5 cards are picked from the deck and given to the player. But if he/she is not satisfied, she/he can change his cards cards

###COMPUTER'S HAND After he is satisfied with his hand, the computer’s cards are now picked randomly from the deck and revealed to the player. change

###ROUND

After that, the round 1 starts. Each pair of cards (PLAYER’S CARD, COMPUTER’S CARD) are compared. And the total values of the cards are also compared. If the total value of the player’s hand is greater than that of the computer, the player wins otherwise he loses the round. But a draw round can also occur if the hand’s values are equal. yw

###WINNER At the last round, the final winner is announced. vict

About

Card Game using c++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published