CLI-UNO
ReadyAbout
Full-featured UNO card game with Flask REST API and multiple AI difficulty levels using game theory algorithms. Implements utility-based decision making and strategic play patterns.
Motivation
After learning adversarial search and utility functions in my AI Algorithms course, I wanted to apply minimax thinking to a real game. UNO provided the perfect testbed - complex enough to showcase strategic AI but simple enough to implement in an afternoon. The project evolved from CLI to REST API, demonstrating how clean architecture enables seamless platform transitions.
Use Cases
Ai Learning
Practical application of adversarial search, utility functions, and strategic decision-making algorithms
Architecture Demo
Demonstrates clean separation between game logic, AI, and interface layers enabling platform flexibility
Difficulty Scaling
Shows progression from random play to strategic utility-based AI across three difficulty tiers
Api Design
REST API architecture supporting multiplayer game state management and JSON serialization
Examples
Utility-Based AI Decision Making
def calculate_card_utility(self, card, opponent_hand_size):
utility = 0
# Threat response for low opponent hand count
if opponent_hand_size <= 3:
if card.value == 'draw2': utility += 15
if card.value == 'wild_draw4': utility += 20
if card.value in ['skip', 'reverse']: utility += 10
# Card value management
if card.card_type == 'number':
utility += int(card.value) # Prefer high numbers
# Wild management (save as backup)
if card.card_type == 'wild' and card.value == 'wild':
utility -= 5
return utility
Key Achievements
- Designed object-oriented architecture with Card, Deck, and GameState classes following inheritance patterns for extensibility
- Implemented three AI difficulty tiers using game theory concepts: random selection, heuristic strategy, and utility-based decision making
- Developed utility function evaluating card plays based on threat assessment, card value management, and optimal color selection
- Built Flask REST API with JSON serialization enabling seamless transition from CLI to web platform