Solly

Klondike solitaire, the way it ought to be: quick to start, easy on the eyes, and every deal can be one the built-in solver has already won.

Version 0.8.5 · C23 and raylib 5.5 · Windows, macOS and Linux · MIT License · Screenshots and logs from 28 November 2026

Solly mid-game: green felt table with the stock, waste, four foundations and seven tableau columns, toolbar along the top and score, moves and time in the status bar

What Solly is

Solly is the classic patience game: build the four foundations from Ace to King and clear the tableau. It is a small native program with no ads, accounts or tracking, and it remembers your games in a local SQLite database for its statistics.

6,905lines of C, including tests and tools
3 / 3test programs pass
0compiler warnings in Solly's own code
23 sclean Release build, raylib and SQLite included
10,002winnable deals in the starter database

The table

The stock and waste sit top left, the four foundations top right and the seven tableau columns below. The toolbar holds New Game, End Game, Undo, Hint and Pause on the left; full screen, Statistics, Settings and About on the right. The status bar shows the deal type, score, moves and time.

A fresh deal, light. Seed 42, Draw 1, Winnable. Undo is hidden because the no-longer-winnable warning is on by default, which turns the Undo button off.
The same deal, dark. Cards and felt follow the system's light or dark setting as it changes.
Draw 3. A Random deal 30 moves in, with three waste cards fanned out and all four Aces home.
Minimum window. 900×480 design pixels (1800×960 in these screenshots): the toolbar keeps its labels and the cards scale down.

Playing

Forty moves in. The first column has grown long, so its face-down cards squeeze together to keep it on screen; it fans out under the mouse.
Hint. The solver found a winning line and outlines the next move; the status bar spells it out: “Hint: move the 4 of spades onto the 5 of hearts”.
No longer winnable. Raised when the background solver proves the position lost. Its buttons stay faded for the first second so a quick click on the board can't hit them. (Forced here with the debug-only Ctrl+Shift+A.)
Asking first. Anything that would throw away a game in progress asks before doing it.
Paused. The clock stops and the cards disappear, so no peeking. Minimizing the window pauses too.
Welcome. Solly opens on the empty table; New Game or N deals.

Panels

Statistics. The last five games, with a medal and points for wins and a Replay button for each, and totals by period. The rows here are sample data made for the screenshot.
Settings. Draw, Draw from (stock on the left or right), Deals, the warning, the Hint and Undo buttons, Timer and Score, saved to settings.ini as they change. The warning is greyed out under Random deals.
About. Version, license and the keyboard shortcuts, with Mac or PC key names to suit the machine.

Keys

Windows / LinuxmacOSAction
N / F2N / F2New game
Ctrl+ECmd+EEnd game
F3F3New winnable game
UUUndo
HHHint
PPPause or resume
SSStatistics
F1F1About
Ctrl+,Cmd+,Settings
F11Ctrl+Cmd+FFull screen
Ctrl+QCmd+QQuit

Celebrations

Each win plays one of four animations, picked at random (or fixed with --celebration), under a banner with the score, moves and time.

Cascade. Cards bounce off the foundations, leaving trails.
Fireworks. Rockets and bursts over the finished foundations.
Whirlwind. The deck spins out into a ring.
Shower. Cards and confetti tumble down the screen.

Inside

Solly is plain C23 (constexpr, nullptr, typed enums) built with CMake and Ninja. CMake fetches raylib 5.5 and patches it to build as C only, and fetches the SQLite 3.50.4 amalgamation; both are linked statically. Windows builds with clang-cl or MinGW, since MSVC's cl lacks C23.

FileLinesWhat it does
src/main.c3,187Everything on screen: layout, input, drag and drop, animation, undo, hint, the unwinnable check, toolbar, status bar, panels, command line and the main loop.
src/store.c476The SQLite database: solver verdicts per deal and one row per game played.
src/celebration.c434The four win animations.
src/system_theme.c383Light/dark detection with change notifications on each OS, the Windows title bar, full screen on macOS and Linux.
src/solver.c302Iterative depth-first solver that runs in slices, so a search can be spread over frames.
src/deal_finder.c234Low-priority background thread that solves random deals until each draw count has 50,000 winnable ones.
src/klondike.c209The game rules and state; no graphics, no I/O.
src/settings.c138settings.ini.
tests/910Three test programs with a shared CHECK macro, no framework.
tools/dealgen.c127Builds the starter database on several threads.

A seed always deals the same game under the same rules, because the database stores verdicts and plays by seed. KL_DEAL_VERSION guards that promise, and a pinned-deals test fails if the shuffle, deck order, dealing pattern or move rules ever change without a version bump.

The solver and winnable deals

The solver plays “thoughtful” solitaire: it can see the face-down cards. A verdict of lost means proven: every line was searched to the end. A search that runs out of its node budget reports unknown instead.

SourceDrawWonLostUnknownNotes
Solver test, 200k nodes183413100 deals, 25.3 ms per deal
3761014100 deals, 26.2 ms per deal
Starter database, 3M nodes15,001194888shipped as assets/data/solly.db (576 KB)
35,0011,041571
dealgen run below12018288 threads, 28 s
32003717

With all cards visible, most deals can be won: of the starter database's deals that got a verdict, about 96% of Draw 1 and 83% of Draw 3 are winnable. Draw 3 loses outright more often, while Draw 1 leaves more searches undecided at the node limit.

Logs

From a clean Release build of commit 923edb9 (version 0.8.5) on Fedora Linux 45 with GCC 16.2.1, in a fresh build folder. Paths are shortened: . is the checkout and build-overview/ the script's build folder.

Tests 3 of 3 passed · 13.8 s
$ ctest --test-dir build-overview/release --output-on-failure
Test project build-overview/release
    Start 1: solly_test_klondike
1/3 Test #1: solly_test_klondike ..............   Passed    0.08 sec
    Start 2: solly_test_solver
2/3 Test #2: solly_test_solver ................   Passed    5.21 sec
    Start 3: solly_test_store
3/3 Test #3: solly_test_store .................   Passed    8.50 sec

100% tests passed, 0 tests failed out of 3

Total Test time (real) =  13.79 sec
Test program output each run on its own
== solly_test_klondike
random play: 16/300 games won
all klondike tests passed
== solly_test_solver
draw 1, 100 deals, limit 200000: 83 won, 4 lost, 13 unknown; 25.3 ms/deal avg, max 200000 nodes
draw 3, 100 deals, limit 200000: 76 won, 10 lost, 14 unknown; 26.2 ms/deal avg, max 200000 nodes
all solver tests passed
== solly_test_store
solly: database deal version 0 is older than 1; clearing deals
solly: database: unable to open database: no/such/starter.db
solly: database deal version 2 is newer than this Solly (1)
deal finder: 100% of a core busy, 25% idle, 43% with the game stopped
store tests passed
The "solly:" lines from solly_test_store are expected: it checks that an old
database is cleared, that a missing starter file is handled, and that a newer
database is refused. "random play" is a smoke test of random moves, not the solver.
Build 51 steps · 23 s 4 warnings in bundled libraries
$ cmake --build build-overview/release -j
[1/51] Copying assets
[2/51] Building C object CMakeFiles/solly_store.dir/src/deal_finder.c.o
[4/51] Building C object CMakeFiles/solly_store.dir/src/store.c.o
[8/51] Building C object CMakeFiles/klondike.dir/src/solver.c.o
[9/51] Building C object CMakeFiles/klondike.dir/src/klondike.c.o
[13/51] Linking C static library libklondike.a
[30/51] Building C object CMakeFiles/solly.dir/src/settings.c.o
[31/51] Building C object CMakeFiles/solly_test_solver.dir/tests/solly_test_solver.c.o
[32/51] Building C object CMakeFiles/solly.dir/src/system_theme.c.o
[33/51] Linking C executable solly_test_solver
[35/51] Building C object CMakeFiles/solly.dir/src/celebration.c.o
[36/51] Building C object CMakeFiles/solly_test_klondike.dir/tests/solly_test_klondike.c.o
[37/51] Linking C executable solly_test_klondike
[38/51] Building C object CMakeFiles/solly_test_store.dir/tests/solly_test_store.c.o
[41/51] Building C object CMakeFiles/solly.dir/src/main.c.o
[47/51] Building C object CMakeFiles/solly_sqlite.dir/build-overview/_deps/sqlite-src/sqlite3.c.o
[48/51] Linking C static library libsolly_sqlite.a
[49/51] Linking C static library libsolly_store.a
[50/51] Linking C executable solly_test_store
[51/51] Linking C executable solly
   (raylib and GLFW steps omitted)

real    23.1 s

Warnings:
build-overview/_deps/raylib-src/src/external/jar_mod.h:370: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]  (4 times)
Configure OK
$ cmake -S . -B build-overview/release -G Ninja -DCMAKE_BUILD_TYPE=Release
-- The C compiler identification is GNU 16.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Performing Test COMPILER_HAS_THOSE_TOGGLES
-- Performing Test COMPILER_HAS_THOSE_TOGGLES - Success
-- Testing if -Werror=pointer-arith can be used -- compiles
-- Testing if -Werror=implicit-function-declaration can be used -- compiles
-- Testing if -fno-strict-aliasing can be used -- compiles
-- Using raylib's GLFW
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Including X11 support
-- Found X11: /usr/include
-- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so
-- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Audio Backend: miniaudio
-- Building raylib static library
-- Generated build type: Release
-- Compiling with the flags:
--   PLATFORM=PLATFORM_DESKTOP
--   GRAPHICS=GRAPHICS_API_OPENGL_33
-- Configuring done (0.5s)
-- Generating done (0.0s)
-- Build files have been written to: build-overview/release
Deal generator 200 winnable per draw count in 28 s
$ solly_dealgen --db dealgen-test.db --winnable 200 --threads 8 --seed 1
dealgen-test.db, before:
  draw 1: 0 winnable, 0 lost, 0 unknown
  draw 3: 0 winnable, 0 lost, 0 unknown
10s:
  draw 1: 85 winnable, 3 lost, 5 unknown
  draw 3: 84 winnable, 19 lost, 7 unknown
20s:
  draw 1: 162 winnable, 6 lost, 15 unknown
  draw 3: 161 winnable, 33 lost, 14 unknown
done in 28s:
  draw 1: 201 winnable, 8 lost, 28 unknown
  draw 3: 200 winnable, 37 lost, 17 unknown

real    27.6 s
Screenshot run exit 0, no output
$ solly --seed 42 --size 2400x1440 --screenshot run.png
$ echo $?
0

How this was made

The table screenshots come from Solly's own --screenshot option, which renders a deal at a given window size and exits. For the panels, the hint, the warning and the celebrations, a debug build runs scripted steps (--shot-script) before the picture is taken: play the first moves of the solver's solution, open a panel, ask for a hint, or use the debug-only test endgame and let the celebration run for a few seconds. Release builds leave that out. Everything ran against a scratch configuration folder, so no real settings or statistics were touched, and the games in the Statistics screenshot are sample data. The whole page, screenshots and logs included, is regenerated by tools/make_overview.py.

Captured at 2400×1440 and scaled to at most 1600 pixels wide. Click any screenshot for a larger view.