Task 2: Giving out the personal hands and flop [20 marks] At the beginning of each game, both players (the user and the

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Task 2: Giving out the personal hands and flop [20 marks] At the beginning of each game, both players (the user and the

Post by answerhappygod »

Task 2: Giving out the personal hands and flop [20 marks] At the
beginning of each game, both players (the user and the AI) will
receive two down cards as their personal hands. Simultaneously,
three board cards are given as the flop. Note that, each player
holds a personal hand (the two down cards) and will not show it to
the other player. Meanwhile,
both players are able to see the flop (the three board
cards).
Please write a program that 3
1. randomly assigns the user two cards as personal hand and
print the two cards she/he receives in the console. [5 marks]
2. randomly selects out three cards as the flop and print the
three cards in the console. [5 marks]
3. randomly assigns the AI player two cards as its personal
hand. [5 marks]
4. writes the two personal hands and the flop in a file named
“pokerhandhistory.txt” in the same form given by the example below
(“XXX” stands for the username). [5 marks] XXX: [Ac, Ah]. AI: [Js,
10d]. Flop: [Qd, 10h, 2c] Please note: Each card is unique. So, no
two same cards can appear in a single game.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply