Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Design Operation And Evaluation Of Mobile Communications

Authors: Gavriel Salvendy ,June Wei

1st Edition

3030770249, 978-3030770242

More Books

Students also viewed these Programming questions