Skip to content

Latest commit

 

History

History
46 lines (32 loc) · 1.52 KB

File metadata and controls

46 lines (32 loc) · 1.52 KB

🃏 CardGame – Python OOP & Unit Testing Project

A command-line based card game built with Python, demonstrating solid Object-Oriented Programming principles and test-driven development using unittest.

📦 Project Structure

  • card.py – Defines the Card class, representing a single playing card.
  • deck_of_cards.py – Manages the DeckOfCards class, including deck creation, shuffling, and drawing.
  • player.py – Contains the Player class, handling player hands and actions.
  • card_game.py – Main game logic class that simulates a round-based card game between two players.
  • test_*.py – Unit tests for each main component.

🚀 Features

  • Fully modular OOP structure (Card, Deck, Player, Game)
  • CLI-based gameplay simulation
  • Randomized deck with shuffling and drawing
  • Robust edge case handling (e.g., empty deck, insufficient cards)
  • 100% unit test coverage for key components
  • TDD development approach using Python’s built-in unittest library

🧪 How to Run Tests

python -m unittest discover

🛠 Technologies

  • Python 3.x
  • unittest
  • random module
  • Command Line Interface (CLI)

📚 Learning Goals

  • Deepen understanding of class relationships and encapsulation
  • Practice TDD (Test-Driven Development)
  • Handle game logic, state management, and input validation
  • Organize a clean and testable Python codebase

👨‍💻 Author

Ilay Marciano
LinkedInGitHub