Simple game of War

Playing cards with a king of spades as the center card.

The main purpose of this project was to use abstract data structures to simulate a simple card game of War.

The goal of War is to be the first player to win all 52 cards. A deck of cards is divided evenly with each player receiving 26 cards, dealt one at a time face down. Each player will turn up a card at the same time and the player with the higher card value takes both cards face down on the bottom of their stack. If the cards are the same rank, war is initiated. Each player will place three cards down and one card up. The player with the higher faced-up card wins the war, takes all the cards, and places them on the bottom of their pile.

My role was to create a program that simulates a card game of War given these files:

The given files were written by my professor and the program that implements the files by my professor was written entirely by me with the help of teaching assistants and various class materials.

While this project did not include any fancy graphics or user interfaces, I learned from this experience that I am capable of creating more kinds of games using more optimal algorithms and utilizing data structures to enhance gameplay efficiency.