Skip to the content.

๐ŸŽฎ UNO Card Game - Python Edition

**A Console-Based UNO Card Game Implementation in Python** > Play against the computer in this exciting implementation of the classic UNO card game with a beautiful rich terminal UI. [![Python](https://img.shields.io/badge/Python-3.7+-blue.svg)](https://www.python.org/) [![License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE) [![Status](https://img.shields.io/badge/Status-Active-brightgreen.svg)](https://github.com/mayank-gariya/crazy-python-projects-/tree/main/UNO)

๐ŸŽฏ Overview

This is a console-based implementation of the classic UNO card game developed in Python. Challenge yourself against an intelligent computer opponent in a beautifully formatted terminal interface powered by the Rich library. The game provides an interactive experience with real-time card management, game state tracking, and detailed end-game summaries.

Current Version: 1-on-1 gameplay (You vs Computer)
Future Roadmap: Multiplayer support, AI vs AI mode, and Online capabilities


โœจ Features

โœ… Player vs Computer Gameplay - Test your skills against an AI opponent
โœ… Rich Terminal UI - Beautiful, colorful console interface with Rich library
โœ… Card Management - Intuitive card selection and hand management
โœ… Power Cards - Draw Two, Skip, Reverse, Wild, and Wild Draw Four
โœ… Smart Computer AI - Computer makes strategic card plays
โœ… Game Summary - Detailed end-game statistics and winner announcement
โœ… Real-time Feedback - Instant notifications for game events (UNO!, card plays, etc.)
โœ… Standard UNO Rules - Fully compliant with official UNO game rules


๐ŸŽฒ UNO Game Rules

Basic Rules

Card Types

Number Cards (0-9)

Action Cards

Wild Cards

Winning Condition


๐Ÿ›  Tech Stack

Technology Purpose
Python 3.7+ Core game logic and implementation
Rich Beautiful console UI with colors and formatting
NumPy Optional numerical operations
Random Card shuffling and AI decision-making

Installation Requirements

pip install rich

๐Ÿ“ Project Structure

UNO/
โ”œโ”€โ”€ app.py                      # Main application entry point
โ”œโ”€โ”€ logic_rich.py               # Enhanced game logic with Rich UI
โ”œโ”€โ”€ deck.py                     # UNO deck generation and management
โ”œโ”€โ”€ UNO_rules.py                # Game rules and card validation
โ”œโ”€โ”€ card_showing_logic.py       # Card display and formatting
โ”œโ”€โ”€ summary.py                  # Game summary and statistics
โ”œโ”€โ”€ requirenment.txt            # Project dependencies
โ””โ”€โ”€ README.md                   # This file

File Descriptions

๐ŸŽฎ app.py

๐Ÿง  logic_rich.py

๐ŸŽฏ logic.py

๐Ÿƒ deck.py

โš–๏ธ UNO_rules.py

๐ŸŽจ card_showing_logic.py

๐Ÿ“Š summary.py


๐Ÿš€ Installation

Prerequisites

Steps

  1. Clone the Repository
    git clone https://github.com/mayank-gariya/crazy-python-projects-.git
    cd crazy-python-projects-/UNO
    
  2. Install Dependencies
    pip install -r requirenment.txt
    

Or install Rich directly:

pip install rich
  1. Run the Game
    python app.py
    

๐ŸŽฎ How to Play

Game Start

  1. Run python app.py
  2. The game initializes with both players receiving 7 cards
  3. First card from the deck is placed as the initial discard pile card

Your Turn (Player)

  1. View Your Cards: Enter show to display all your cards with numbers
  2. Play a Card: Enter the card number corresponding to your card
    • Valid cards must match the color OR number OR be a Wild card
  3. Draw a Card: If you canโ€™t play, select โ€œNโ€ to draw a card
  4. UNO: When you have 1 card left, โ€œUNO!โ€ is automatically announced

Computerโ€™s Turn

Game End


๐Ÿš€ Future Enhancements

Phase 2: Multiplayer Mode

Phase 3: Advanced AI & Modes

Phase 4: Online Capabilities

Phase 5: Additional Features


๐Ÿ“Š Game Summary Details

After each game, youโ€™ll receive a detailed summary including:


๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ’ก Tips & Tricks


๐Ÿ“ง Contact & Support

Developer: Mayank Gariya
GitHub: mayank-gariya
Repository: crazy-python-projects-