Question
Program a simple game that shuffles a deck of 52 cards and hands them out to two players randomly (26 each). Write a simulation of
Program a simple game that shuffles a deck of 52 cards and hands them out to two players randomly (26 each). Write a simulation of the card game, where, at each turn, both players take the card from the top of their pile and the player with the higher card wins that round. The winner of that round takes both cards and adds it to a stack of won cards. In essence, there are four stacks. Each player has one stack of cards they are playing with and one stack of cards they have won. There are 26 rounds, since each player has a full stack of cards. At the end of the game, the player with the most cards in their won pile wins. Note: The deck of cards can simply hold an integer between 0 and 51. The higher number wins. Dont worry about implementing suits like spades, hearts, etc. To do: In LinkedStack.java Implement pop(), peek(), and toString() methods In CardGame.java Design and implement the game play logic
-JAVA
-implemented using Stack ADT
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