/War

Primary LanguageC#

War

  \\\   /^\   ///   /^\    |||D))
   \\\ //^\\ ///   //^\\   |||\\\
    \\V// \\V//   ///=\\\  ||| \\\

Plays the card game so you don't have to.

If there is anything we can learn from being developers it is that the primary reason for writing to code it to automate repetitive tasks we don't particularly want to do over and over again. As someone currently on vacation, the most obvious target for automation is the card game war.

For those of you who have never played war, The Idea is that you divide a deck of cards (sans jokers) evenly among the participants and the play tricks. In each trick the player with the highest value takes the trick and adds the cards to the bottom of their deck. In the event of a tie, the players who have tied play 3 cards face down and then a single card face up. Winner takes all. Play continues until one player has all the cards. This can take a while.

As developers we frequently discover situations where frankly the outcome is never in question from the initial state. War is one of those cases. There may be some shuffling of cards, typically used for cheating, but the essential outcome is determined nearly entirely by the initial deal. If you end up the the aces you are only going to lose them in a tie.

Facing the possibility of playing an entire day of games of war, any developer worth their salt will think, "I COULD AUTOMATE THIS".

I have done this for you.

Now you can declare wars and resolve them in a reasonable amount of time. Heck, you can use it to make important decisions. Now that a war can be resolved in seconds rather than hours or, potentially, days you can war to your heart's content.