Here's an example implementation of the card game War in C#:
main.cs6107 chars215 lines
This implementation uses object-oriented programming to represent Cards and Suits as enums, and the game logic is implemented in a while-loop that iteratively draws cards from each player's deck and compares them. In the event of a tie, a "war" occurs where three cards are drawn from each player's deck and the fourth card drawn determines the winner.
gistlibby LogSnag