Snap!!


Snap

A classic game of Snap implemented in C++ with Unicode card visualization in the console.

Features

  • Play against the computer or another player.
  • Three difficulty levels: Easy, Medium, Hard.
  • Unicode characters for visually appealing card display.
  • Real-time keyboard input for calling “Snap”.
  • Animated countdown and clear instructions.

How to Play

  1. Run the program.
  2. Choose the number of players (1 or 2).
  3. If playing against the computer, select a difficulty.
  4. Take turns playing cards. When two consecutive cards match in value or suit, press your Snap key:
    • Player 1: S
    • Player 2: P (in 2-player mode)
  5. The fastest player to call “Snap” wins the pile.
  6. The game ends when a player runs out of cards.

Controls

  • S: Player 1 calls Snap
  • P: Player 2 calls Snap (2-player mode)

Requirements

  • Windows OS (uses Windows-specific console features)
  • C++17 or later

Build Instructions

  1. Open the project in your preferred C++ IDE (e.g., Visual Studio).
  2. Build all .cpp files together:
    • main.cpp
    • Snap.cpp
    • Deck.cpp
    • Card.cpp
  3. Run the resulting executable.

File Structure

  • main.cpp - Entry point
  • Snap.h / Snap.cpp - Game logic and flow
  • Deck.h / Deck.cpp - Deck management
  • Card.h / Card.cpp - Card representation and display
  • README.md - Project documentation

License

This project is for educational purposes.