Skip to the content.

Solitaire (Klondike)

Overview

Klondike Solitaire is the classic single-player card game where you build foundation piles from Ace to King by suit, using a tableau of seven columns.

Status: πŸ”œ Coming Soon
Players: 1
Difficulty: Easy
Deck: 1 standard 52-card deck

Objective

Move all 52 cards to the four foundation piles, building each suit from Ace to King.

Rules

Layout

Tableau: Seven columns of cards

Stock: Remaining 24 cards face down

Waste: Cards drawn from stock

Foundation: Four empty piles (one for each suit)

Building Rules

Tableau:

Foundation:

Moving Cards

  1. Tableau to Tableau: Build down, alternating colors
  2. Tableau to Foundation: Build up by suit
  3. Stock to Waste: Draw cards (1 or 3 at a time)
  4. Waste to Tableau: Top card only
  5. Waste to Foundation: Top card only
  6. Foundation to Tableau: Allowed but rarely useful

How to Play

Step 1: Setup

Step 2: Make Initial Moves

Step 3: Draw from Stock

Step 4: Build Foundations

Step 5: Manage Tableau

Step 6: Win Condition

Strategy Tips

General Strategy

  1. Expose face-down cards first - Priority #1
  2. Don’t rush to foundation - Keep cards in tableau for building
  3. Empty columns are valuable - Use for Kings only
  4. Plan ahead - Think 2-3 moves ahead
  5. Aces and 2s to foundation - Safe to move immediately

Advanced Tips

  1. Keep color balance - Don’t block yourself with same colors
  2. Build evenly - Don’t build one suit too high
  3. Use undo wisely - Learn from mistakes
  4. Cycle stock carefully - Remember what’s coming
  5. Kings in empty columns - Choose wisely which King to place

Common Mistakes

  1. Moving cards to foundation too early - May need them for building
  2. Filling empty columns with wrong King - Blocks future moves
  3. Not planning ahead - Random moves lead to dead ends
  4. Ignoring face-down cards - Always prioritize uncovering
  5. Giving up too early - Many games are winnable with patience

Scoring (Optional)

Standard Scoring

Time Bonus

Vegas Scoring

Implementation Details

Planned Features

API Endpoints

GET https://deckofcardsapi.com/api/deck/new/shuffle/?deck_count=1
GET https://deckofcardsapi.com/api/deck/{deck_id}/draw/?count=28  # Tableau
GET https://deckofcardsapi.com/api/deck/{deck_id}/draw/?count=24  # Stock

Technical Implementation

class SolitaireGame {
  final String deckId;
  final List<List<CardModel>> tableau; // 7 columns
  final List<List<CardModel>> foundation; // 4 piles
  final List<CardModel> stock;
  final List<CardModel> waste;
  final int moves;
  final int score;
  final Duration elapsed;
  final SolitaireDrawMode drawMode; // draw1 or draw3
}

class CardModel {
  final String code;
  final String suit;
  final String value;
  final bool isFaceUp;
  final bool isInFoundation;
  final int tableauColumn;
  final int foundationPile;
}

enum SolitaireDrawMode { draw1, draw3 }

Algorithms Needed

  1. Valid Move Detection: Check if move is legal
  2. Auto-Complete: Detect when game is won
  3. Hint System: Suggest best next move
  4. Undo/Redo: Track move history
  5. Win Detection: Check if game is solvable

Variations

Draw 1 vs Draw 3

Thoughtful Solitaire

Vegas Solitaire

Statistics

Win Rate

Average Game Time

Glossary

References