A feature-rich, text-based implementation of the classic UNO card game built entirely in Java.
Play the beloved UNO card game right from your terminal — solo against a smart bot or with up to 4 friends!
Getting Started • Features • Screenshots • Architecture • Contributing
UNO Console Game is a fully-featured, terminal-based recreation of the iconic UNO card game. Built with clean Object-Oriented Programming principles in Java, the game delivers a smooth and colorful CLI experience complete with ANSI-colored cards, typewriter animations, and an intelligent bot opponent.
Whether you want a quick solo game against the bot or a multiplayer session with friends gathered around one terminal, this project brings the fun of UNO to the command line.
| Feature | Description |
|---|---|
| 🤖 Smart Bot AI | Play against an intelligent bot that strategically picks cards based on color frequency and card type |
| 👥 Multiplayer | Support for 2, 3, or 4 human players on the same terminal |
| 🎨 Colored Output | ANSI color-coded cards (🔴 Red, 🔵 Blue, 🟢 Green, 🟡 Yellow) for an immersive experience |
| 🔄 Full UNO Ruleset | Skip, Reverse, Draw Two, Wild, and Wild Draw Four — all action cards implemented |
| 🏆 Leaderboard & Scoring | Track scores across multiple rounds with a ranked leaderboard |
| ⚡ UNO Call Mechanic | Forget to type "UNO" when you're down to one card? That's a 2-card penalty! |
| 🎬 Typewriter Animations | Smooth text animations and timed reveals for a polished feel |
| 🔁 Multi-Round Support | Play multiple rounds in a single session with persistent scoring |
Choose between Player vs Bot, 2 Players, 3 Players, or 4 Players mode.
Clean, focused UI for each player's turn with privacy protection in multiplayer.
View your hand, playable cards, and choose your next move. Cards are color-coded for easy identification.
- Java 17 or higher — Download here
- A terminal that supports ANSI color codes (Windows Terminal, Git Bash, macOS Terminal, Linux Terminal)
# 1. Clone the repository
git clone https://github.com/haroune-dev/UNO-Console-Game.git
# 2. Navigate to the project directory
cd UNO-Console-Game
# 3. Compile the source files (Linux/macOS or Git Bash)
javac -d bin src/**/*.java
# On Windows CMD, use explicit paths:
javac -d bin src\cards\*.java src\deck\*.java src\player\*.java src\enumTypes\*.java src\game\*.java
# 4. Run the game
java -cp bin game.Drive- Import the project into Eclipse (
File → Import → Existing Projects) - Run
Drive.javaas a Java Application - Enjoy! 🎉
The project follows a clean, modular architecture using core OOP principles — inheritance, polymorphism, encapsulation, and abstraction.
UNO-Console-Game/
├── src/
│ ├── cards/ # Card hierarchy (Abstract → Concrete)
│ │ ├── Card.java # Abstract base class
│ │ ├── ColoredCard.java # Abstract colored card
│ │ ├── NumberedColoredCard.java
│ │ ├── DrawTwoCard.java
│ │ ├── ReverseCard.java
│ │ ├── SkipCard.java
│ │ ├── WildCard.java # Abstract wild card
│ │ ├── WildColorCard.java
│ │ └── WildColorDrawFourCard.java
│ │
│ ├── deck/ # Deck management
│ │ ├── Deck.java # Abstract deck
│ │ ├── DrawPile.java # Draw pile with shuffle & refill
│ │ └── DiscardPile.java # Discard pile
│ │
│ ├── player/ # Player management
│ │ ├── Player.java # Player entity (human & bot)
│ │ └── PlayerHand.java # Hand management
│ │
│ ├── enumTypes/ # Game enumerations
│ │ ├── Color.java # RED, BLUE, GREEN, YELLOW
│ │ └── Number.java # ZERO through NINE
│ │
│ └── game/ # Game engine
│ ├── Drive.java # Entry point (main)
│ ├── GameController.java # Core game logic & rules
│ └── GameSession.java # UI, I/O, and session management
│
├── screenshots/ # Project screenshots
└── README.md
- Abstract Card Hierarchy —
Card→ColoredCard/WildCard→ Concrete cards. Each card type implements its ownmatches()andapplyEffect()logic via polymorphism. - Separation of Concerns —
GameControllerhandles rules and state,GameSessionmanages UI and player interaction, andDriveserves as the entry point. - Bot Strategy Pattern — The bot selects cards based on a scoring algorithm that evaluates color frequency and card type in its hand.
- Standard 108-Card Deck — Faithfully implements the official UNO deck composition.
- Start the game and choose a game mode (Player vs Bot or Multiplayer)
- Enter player names when prompted
- On your turn:
- View the top card on the discard pile
- See your hand and playable cards
- Select a card to play, or draw if you have no valid moves
- Action cards trigger immediately:
- Reverse — Changes the turn direction
- Skip — Skips the next player
- Draw Two — Next player draws 2 cards and loses their turn
- Wild — Choose any color to continue
- Wild Draw Four — Choose a color + next player draws 4 cards
- Say UNO! — Type
unowhen finishing your turn with 1 card remaining, or face a 2-card penalty - Win by being the first player to empty your hand!
| Technology | Purpose |
|---|---|
| Java 17+ | Core language with modern switch expressions |
| OOP | Inheritance, polymorphism, encapsulation, abstraction |
| ANSI Escape Codes | Terminal colors and text styling |
| Collections Framework | ArrayList for dynamic hand & deck management |
| Scanner | Terminal input handling |
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Add network multiplayer support
- Implement a tournament mode
- Add card stacking rules (stack Draw Two on Draw Two)
- Create a difficulty setting for the bot AI
- Add save/load game functionality
- Haroune-dev
- ayoubgz1
- 0xraouf Abderraouf
- AbdelhadiZA
⭐ If you enjoyed this project, consider giving it a star! ⭐

