Note: You should not use class for this project
Develop a simple poker game. You need to design appropriate variables for 1) the game machine and 2) the players. The former should include variables representing the amount of money in the pot and remaining cards that havent been revealed. The latter should include the player name, player number, and the amount of money on his/her account. You need to add additional variables in the program if you feel necessary. The game plays as following.
a)In the beginning of the game, it will ask you how many players. Each player will have an initial $100 on his/her account. The initial amount of money in the pot of the game machine is $50. Also, the game machine will generate a random sequence of 52 cards. You can ignore the type of a card (i.e., spades, hearts, diamonds, and clubs) and just have 4 of each number in the range of 1 to 13.
b)The game plays round by round. In each round, the game machine will show the two cards in the front of the card sequence (suppose it is 8 and Q) and remove them from the card sequence. Then, all players bet sequentially.
c)When the number of remaining cards in the card sequence is smaller than 3. The game machine will shuffle and generate another random sequence of 52 cards. Then the game will continue from the front of the new card sequence. You need to prompt so on the console when it happens.
d)Note: whenever the amount of money in the pot becomes 0, each player has to pay $10 to the pot from her account, so that the game can continue. You need to give a hint on console when this happens.
e)Note: If the amount of money on a players account becomes 0, he/she loses the game and will be kicked out. This player will no longer be involved in further rounds of the game. You need to give a hint on console when a player is kicked out.
Note: Please submit to the same submission folder of your first project
The task of this project is to further modularize the poker game you have implemented in the first project through class and multi-file programming. You will need to implement the following.
1.Design three classes in your program:
You will need to design appropriate data members and function members for the three classes. Obviously, the GameConsole class will contain an object of the Deck class and an array of the Player class as data members, which are used to store the deck of cards and players information, respectively.
2.Put the three classes in three pairs of header and source files. Specifically,
3.With appropriate design of the three classes, your main program should look super concise. An example could be the following
int main() {
GameConsole gGamesole; //declare the game
gGamesole.getPlayerInfo(); //ask how many players and get player information
while (gGamesole.good()) {//check whether the game should continue or not
gGamesole.playOneRound(); //play one round
}
return 0;
}
Obviously, you have to carefully design what should the playOneRound() function do and what should the good() function check. The game logic is the same as the in the first project: 1) Players bet sequentially; 2) The deck would change the cards as long as one player wins; 3) A shuffle is needed when the remaining amount of cards is <=3; 4) A player quits if his/her money is <=0; 5) The game stops when either all players have lost their money or all have chosen to quit.