This is the introduction for the second "Mega Challenge" called MegaChallengeWar. This challenge will test your knowledge of Lists, Collections, Initializers and Classes. It's a lengthy challenge that requires a lot of forethought, so read the instructions carefully before proceeding. As always, if you run into any problems, the solution is available to refer to, so that you can see one way to complete this challenge.
Your application will simulate the card game of War. If you're unfamiliar with the exact rules of war, refer to this link: https://en.wikipedia.org/wiki/War_(card_game)
In essence, war is a game where two players are each randomly dealt 26 cards (half the deck), then "battle" each other until one player runs out of cards. On each turn, both players reveal the top card of their deck and compare the values. Whichever player has the greater value card (2 is low, Ace is high) wins, taking both battle cards and placing them at the bottom of their deck.
The one exception to this rule is when there is a war. Wars happen when the revealed cards have identical values (i.e. Jack of Hearts and Jack of Spades). When a war takes place, the original two battle cards are joined by three more cards from each player's deck, making the bounty a total of four cards from each player. Then, to decide who wins, players compare the second of the three new cards that were revealed. If one is greater than the other, that player wins and adds all eight cards to the bottom of their deck.
Your job is to create an application that simulates this gameplay, but for the computer. Two players will be dealt cards, compare them, battle and resolve the battle over and over until one of two conditions is met: 1) One player runs out of cards or 2) 20 Rounds have occurred. In the interest of time, we will cut the game off at 20 rounds, because depending on how random the deal is, the game could go on for a very long time.
Your application will display the following information to the user when they click the Play button on the form.
When the game is played, it should look like this when dealing the cards to players:
Note: The coloring for the final result of which player won is an optional challenge
You will be provided a folder with these screenshots for reference when building your application. Make sure when creating your application to make use of different Lists, Collections and classes. Do your best to keep your classes and methods cohesive and to the point. Separate your concerns out to the best of your ability. Sometimes, that will mean some of your methods are no longer than a few lines, but that's ok. It's better for your methods to be short and specific than long and generic. Review what we've learned so far about these concepts and do your best. Don't forget to check the solution for help if you need it. Good luck!
Mega Challenge War