A simple snap card game built with Java. This project demonstrates the implementation of core object-oriented principles, game mechanics, and logic for a card game.
- Deck creation and shuffling
- Player hands and game rounds
- Basic card game logic
- Time-out feature
- Java 11+
- Maven (for dependency management)
- Clone the repository:
git clone https://github.com/J0EYWEB/java-card-game.git
- Navigate to the project directory:
cd java-card-game - Build the project using Maven:
mvn clean install
- Run the game:
mvn exec:java -Dexec.mainClass="org.example.Main"
- select which card game you want to play (only snap currently)
- Enter the names of each player
- Players take turns pressing enter to draw a card
- When a card matches the previous one, the play must type 'snap' within 2 seconds.
- If the player does not type 'snap' within 2 seconds, the opponent wins automatically.
- if 'snap' is not typed correctly or the enter key is accidentally hit before any characters are typed, the game continues.