This project is a complete, self-contained simulation of the classic card game WAR, built independently using Java as part of my curriculum at the College of Southern Nevada Coding Bootcamp. It demonstrates my ability to apply core Object-Oriented Programming (OOP) principles such as encapsulation, class abstraction, and data modeling.
The program is composed of four classes — App, Player, Deck, and Card— each handling distinct responsibilities. The App class acts as the driver, controlling game setup, card distribution, and the main game loop. Two players are created, and a shuffled 52-card deck is instantiated using the Deck class. Players take turns drawing and flipping cards, and the game logic automatically compares card values to determine round winners, increment scores, and ultimately declare a winner or a draw after 26 rounds.
Cards are modeled using the Card class, which stores each card’s name (e.g., “Queen of Hearts”) and numerical value (2 through 14). The describe() method in Card provides a human-readable summary of each card, supporting clear debugging and user output.
The Deck class handles both the creation and shuffling of the card set and includes functionality to reinitialize itself if depleted, ensuring smooth gameplay without manual resets. The Player class manages a player’s hand (a list of cards), score, and card actions (draw, flip, describe, incrementScore).
Knowledge gained from this project:
How to write clean/modular code
Interaction between multiple classes
Object Oriented Programming principles
Practice with Java syntax/Eclipse IDE