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.
- Winnable deals. In Winnable mode Solly deals only games its solver has already won. A background thread keeps solving random deals at low priority, and a starter database of 5,001 winnable deals per draw count ships with the game.
- Hint searches for a winning line from the current position and points at the next move, or says honestly that the game is lost.
- "No longer winnable" warning. In Winnable deals a second solver checks every new position in the background and speaks up only when a loss is proven.
- Click or drag. A click sends a card to its best spot, a right-click sends it home, and once every card is face up Solly finishes the game itself.
- Scores and statistics: traditional untimed scoring, the last five games (each can be replayed), and win rate, games, average score and time for all time, the month, the week, today and the last hour.
- Undo back over a thousand moves, Draw 1 or Draw 3, a pause that hides the board, long columns that squeeze to fit and fan out under the mouse, light and dark cards that follow the system, and four win celebrations.
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.
Playing
Panels
settings.ini as they change. The warning is greyed out under Random deals.Keys
| Windows / Linux | macOS | Action |
|---|---|---|
| N / F2 | N / F2 | New game |
| Ctrl+E | Cmd+E | End game |
| F3 | F3 | New winnable game |
| U | U | Undo |
| H | H | Hint |
| P | P | Pause or resume |
| S | S | Statistics |
| F1 | F1 | About |
| Ctrl+, | Cmd+, | Settings |
| F11 | Ctrl+Cmd+F | Full screen |
| Ctrl+Q | Cmd+Q | Quit |
Celebrations
Each win plays one of four animations, picked at random (or fixed with --celebration),
under a banner with the score, moves and time.
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.
| File | Lines | What it does |
|---|---|---|
src/main.c | 3,187 | Everything 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.c | 476 | The SQLite database: solver verdicts per deal and one row per game played. |
src/celebration.c | 434 | The four win animations. |
src/system_theme.c | 383 | Light/dark detection with change notifications on each OS, the Windows title bar, full screen on macOS and Linux. |
src/solver.c | 302 | Iterative depth-first solver that runs in slices, so a search can be spread over frames. |
src/deal_finder.c | 234 | Low-priority background thread that solves random deals until each draw count has 50,000 winnable ones. |
src/klondike.c | 209 | The game rules and state; no graphics, no I/O. |
src/settings.c | 138 | settings.ini. |
tests/ | 910 | Three test programs with a shared CHECK macro, no framework. |
tools/dealgen.c | 127 | Builds 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.
| Source | Draw | Won | Lost | Unknown | Notes |
|---|---|---|---|---|---|
| Solver test, 200k nodes | 1 | 83 | 4 | 13 | 100 deals, 25.3 ms per deal |
| 3 | 76 | 10 | 14 | 100 deals, 26.2 ms per deal | |
| Starter database, 3M nodes | 1 | 5,001 | 194 | 888 | shipped as assets/data/solly.db (576 KB) |
| 3 | 5,001 | 1,041 | 571 | ||
| dealgen run below | 1 | 201 | 8 | 28 | 8 threads, 28 s |
| 3 | 200 | 37 | 17 |
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.