๐ The Most Over-Engineered Solitaire Game You'll Ever Love
Welcome to what might be the most meticulously crafted Solitaire implementation this side of the digital realm! Written in C++ with more love than your grandmother puts into her secret cookie recipe, this isn't just another card game โ it's a labor of love with enough features to make Windows Solitaire blush.
โจ Features
- Draw-One or Draw-Three Mode: Because sometimes you want it easy, and sometimes you want it Vegas-style
- Custom Card Backs: For when the default just isn't fancy enough for your taste
- Multiple Deck Support: Load custom card decks via ZIP files (perfect for when you want to play with cats or dinosaurs instead of boring old Kings and Queens)
- Fancy Graphics: Powered by Cairo, because we believe pixels should be pretty
- Super Smooth Drag & Drop: More fluid than your morning smoothie
- Auto-Complete Detection: Because we know you were going to win anyway
- Full Keyboard Support: Since sometimes you don't have a mouse.
๐ ๏ธ Building
Prerequisites
- GTK+ 3.0 development libraries
- Cairo graphics library
- libzip
- A C++ compiler that doesn't faint at the sight of modern C++
- For Windows builds: MinGW-w64 with GTK+ development files
Build Steps
The project includes a versatile Makefile with several build targets:
make # Build for Linux (default)
make linux # Explicitly build for Linux
make windows # Build for Windows (requires MinGW)
make all # Build for both Linux and Windows
make clean # Clean up build files
make help # Show available make targets
Linux Build
For a standard Linux build, simply run:
The executable will be created at build/linux/solitaire
Windows Build
For Windows builds (requires MinGW-w64):
This will:
- Create the Windows executable at build/windows/solitaire_gtk.exe
- Automatically collect required DLLs
- Place everything in the build/windows
directory
Build Features
- Uses C++17 standard
- Includes all necessary compiler warnings (-Wall -Wextra)
- Automatically handles platform-specific dependencies
- Separate build directories for Linux and Windows outputs
- Automated DLL collection for Windows builds
๐ฎ Playing the Game
Basic Controls
- Left Click + Drag: Move cards (revolutionary, we know)
- Right Click: Automatically move a card to its foundation (for the lazy among us)
- Left Click on Stock: Draw new cards (draw one or three, depending on your mode)
Keyboard Controls
- Arrow Keys: Navigate around the board (yellow highlight)
- Enter: Select card (highlights to blue) or puts in foundation
- ESC: Deselect card (turns highlight back to yellow)
- F: Finish the game (moves cards to the foundation until it can't move anymore)
- Space: Deal next card(s)
- 1: Change to dealing one card
- 3: Change to dealing three cards at once
- To move a card, select the card you would like to move, press enter, move with arrow keys to new location, and then press enter again
Game Rules
For those who've been living under a rock or just really enjoy reading rules:
- Build four foundation piles (โฃ,โฆ,โฅ,โ ) from Ace to King
- Stack cards in descending order with alternating colors in the tableau
- Only Kings can fill empty tableau spots (they're quite territorial)
- Flip cards from the stock pile when you're stuck
- Get all cards to the foundation piles to win (and trigger our slightly over-enthusiastic victory animation)
๐จ Customization
Custom Card Backs
- Go to Game โ Card Back โ Select Custom Back
- Choose your image file (PNG, JPG, JPEG supported)
- Marvel at your sophisticated taste in card design
Custom Card Decks
- Create a ZIP file with your card images
- Name them properly (e.g., "ace_of_spades.png", "king_of_hearts.png")
- Include a "back.png" for the card back
- Load your deck from Game โ Load Deck
- Enjoy your personally crafted cardtastic experience
๐งช Technical Bits
For the brave souls who dare to venture into the code:
- Card Library: A robust card management system that could probably handle a casino
- Double Buffering: Because we don't like screen tearing
- Cairo Graphics: Making rectangles look good since 2003
- Event System: More signals than a busy traffic intersection
- Resource Management: More careful with memory than your most frugal relative
๐ Known Features (Not Bugs)
- The victory animation is intentionally chaotic with cards flying off the screen
- Cards occasionally show off their athletic abilities with smooth animations
- The auto-complete feature is actually quite smart (it's just shy)
๐ค Contributing
Found a way to make this over-engineered masterpiece even more over-engineered? We'd love to see it! Just:
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
- Wait patiently while we admire your code
๐ License
MIT Licensed - because we believe in freedom (and not writing our own license text).
๐ Acknowledgments
- The GTK+ team for making GUI development interesting
- Cairo developers for the pretty graphics
- The inventor of Solitaire (whoever you are, you beautiful genius)
- Coffee โ - The true MVP of this project
Created by Jason Brian Hall (jasonbrianhall@gmail.com)
Remember: If you're not having fun, you're probably playing Minesweeper instead.
Built with love, caffeine, and probably too many late-night coding sessions.