This kata is a version of the classic card game War.
The rules of this card game are quite simple.
- There are two players.
- The cards are all dealt equally to each player.
- Each round, player 1 lays a card down face up at the same time that player 2 lays a card down face up. Whoever has the highest value card, wins both round and takes both cards.
- The winning cards are added to the bottom of the winners deck.
- Aces are high.
- If both cards are of equal value - three cards are dealt from each hand face down and then 1 more face up to war again. the winner takes all the cards. If this ties repeat the process again.
- The player that runs out of cards loses.
- Turn 1 Tom plays a 4:clubs: Mary Plays a 8:spades: Mary get both cards, they go to the bottom of their pile
- Turn 2 Tom plays a A:spades: Mary Plays a K:spades: Tom get both cards, they go to the bottom of their pile
- Turn 3 Tom plays a 6:spades: Mary Plays a 6♢ Both players add the next 3 cards to the war Tom plays a 8♢ Mary Plays a 9♡ Mary get all 10 cards, they go to the bottom of their pile