Question
write a two card poker game, the user and the computer will get two cards, cards are an integer value between 2-14 and are printed
write a two card poker game, the user and the computer will get two cards, cards are an integer value between 2-14 and are printed out as 2,3,4,5,6,7,8,9,10,J,Q,K,A.
the winner is when: if both players have a pair then the pair with the highest numerical value wins, if only one player has a pair, then the pair wins, if neither the players has a pair, then the player with the highest card wins, if both players highest card is the same, then the winner goes to the player with the second highest card, tie: if both have the exact same cards, it is a tie
output:
[K] [9] Your cards
[Q] [5] Computer's cards
You win
Want to play again? (Y/N) y
[7] [2] Your cards
[10] [5] Computer's cards
You lose
Want to play again? (Y/N) ......
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started