FreeCell

FreeCell laid out on an oxblood leather card table with gilt tooling. Every number from 1 to 1,000,000 is a fixed deal, so a game can be replayed or traded by number. The hint button asks a solver that runs in a background worker inside the page: three short best-first searches with different weightings rather than one long one, which keeps its memory use down on a phone. It finds a win on every one of the first three hundred deals, in six milliseconds on average and a quarter of a second at worst, and the test suite replays its solutions move by move through the rules engine to prove every move legal. Cards that nothing could still need fly home on their own, runs move as one when the free cells and empty columns leave room, and undo goes all the way back to the deal.

vanilla JavaScript · in-page solver · no build step

saves in your browser · the hint button asks a solver running in the page · play full screen ↗

How to play

  • drag a card or a run onto a column, a free cell, or its foundation; or click a card, then click where it goes
  • double-click a card to send it to its best spot: home if it can go, otherwise onto another column or into a free cell
  • build down in alternating colors; a run moves as one when there is room to shuffle it through free cells and empty columns, and a refused move says how many cards you can carry
  • 1-8 pick a column, q w e r pick a free cell, f sends the picked card home
  • ctrl+z undoes and ctrl+shift+z redoes, all the way back to the deal; restart is undoable too
  • h asks the solver for a move, n deals a new game, r restarts this one
  • click the game number to replay any of the million numbered deals

Changelog

  • 2026-11-21·First build. No engine and no build step: plain modules for the rules, the solver, and the table, with every card drawn in the DOM and moved by transform so each move animates on its own. The first solver was a single best-first search, and it gave up on deal one at its two-hundred-thousand-position cap while searches that size were using a quarter of a gigabyte of memory. Three short searches with different weightings, each capped at forty to sixty thousand positions, solve all of the first three hundred deals instead. Before shipping, a test script played the game in a real browser at desktop and phone sizes: ten dragged moves following a solver line, clicks, keys, double-clicks, undo and redo, a hint, a refused move, and a finished game. The screenshots caught two things. The display cut of Bodoni Moda thins the king's arm to almost nothing at card sizes, so court letters use the text cut. And a fifteen-card column ran off the bottom of a short window, so the fan now tightens far enough to fit seventeen.