Question: Exercise 1 You will write an implementation of a simple card game called War. Details of the game's rules can be found here: http://www.bicyclecards.com/how-to-play/war/ This
Exercise 1




You will write an implementation of a simple card game called War. Details of the game's rules can be found here: http://www.bicyclecards.com/how-to-play/war/ This game uses a "standard" deck of playing cards, and involves two players. Each player is dealt half of a randomly shuffled deck (so 26 cards each). During each turn, both players simultaneously flip the top card of their deck. The player who flips the highest value card wins the turn, and "captures" both cards by adding them to the bottom of their deck. If both players flip over cards with the same value, then a "war" begins: each player takes the next two cards from their deck, flipping over one and leaving the second face-down. The flipped cards are compared, and the highest value of these cards determines the winner, who now takes the "war pile" all six cards). If these are also the same value, then the war continues; both players continue drawing two cards from their deck and flipping only the first one to compare values. The ultimate winner takes all cards in the "war pile". After a war, play resumes as normal by flipping and comparing only one card each at a time. Your gameshouldthre class Card,Deck,and Demo. Your game should use three class: Card, Deck, and Demo
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
