A devlog by Neeraj Kotwani, who builds every game on Elipar.
Klondike was the fiftieth game on this site and the first card game of any kind. The rules are not the hard part — most people reading this could write the legal-move checks from memory. The parts that are actually fiddly are undo, and fitting seven columns onto a phone.
The obvious way to write undo is the wrong way
The tempting design is an inverse per move type. Moving a card from column to column? Move it back. Sending one to a foundation? Bring it down again. It feels tidy and it is how you would describe it out loud.
It falls apart because a single solitaire move does more than one thing. Drag a card off a column and you may also have exposed the card underneath, which flips face-up. That flip is a second, hidden state change bundled into the first. Your inverse now has to know whether it caused a flip, and put the card back face-down only if it did — and if it gets that wrong, the mistake is invisible until several moves later when a card nobody should have seen is sitting there face-up.
Then add that the same move might also have scored points, might have completed a foundation pile, and might have been the move that triggered the win check. Every one of those needs reversing too, in the right order.
So undo here stores a whole snapshot of the board instead: stock, waste, the four foundations, the seven columns, the score and the move count, serialised before each move. Undo throws the current state away and restores the last one wholesale.
That is "wasteful" in the sense that it copies fifty-two cards to undo a move that touched one. Fifty-two cards is nothing. What it buys is that undo cannot be subtly wrong — there is no case analysis to get wrong, no flip to remember, no scoring to unwind. The history is capped at 400 entries so a very long game cannot grow it without bound.
I would not write it this way for a game with a large world state. For a deck of cards, the clever version is strictly worse.
Tap to pick up, tap to put down
No dragging. Tap a card, tap where it goes. Double-tap sends it straight to its foundation, and there is a button that sweeps an open board home.
This was a deliberate call rather than laziness. Drag-and-drop is where most browser solitaires fall over on a phone: the gesture competes with scrolling, it needs pointer capture to survive the element being reparented mid-drag, and a card released over nothing in particular has to be animated back. Tap-then-tap is the same gesture on a phone and a desktop, it needs none of that machinery, and a card can never be dropped into a dead zone.
Seven columns, 333 pixels
The card faces are text — the suit characters and a rank — so the whole game is one self-contained file with no images at all. Those four suit symbols are basic and render consistently, unlike the emoji problem that has bitten other games in this catalogue.
Sizing is computed from the container on every resize, and the vertical overlap within a column tightens as that column grows, so a long stack compresses rather than running off the bottom. The constraint to hit is the real embedded frame on the smallest phone I support: a full thirteen-card column still finishes 19px clear of the controls there, and 25px clear on a normal phone.
Two layout collisions came out of screenshots rather than assertions, both of them repeats of mistakes this site has made before. The control row spanned the full width and put the NEW button directly underneath the site's own fullscreen button — the same bottom-right corner that had just been fixed in another game. And the top row of cards started exactly where the HUD ends, so the two butted together with no gap.
Both failing tests were my fault
Fourteen rules tests, two failed first time, and neither was the game.
One had inherited a draw-three setting from the case before it, so it was testing a different game than it thought. The other was more instructive: I built a column as an Ace with a 2 on top of it, to test that a card could be moved off. That board is illegal — a 2 cannot sit on an Ace in the tableau — and the game correctly refused to let either card move. The assertion was wrong, not the rules.
If you hand-write a solitaire position for a test, check the position is legal before you trust what it tells you. A subtly illegal board will fail against perfectly good code and send you hunting through the rules engine for a bug that is sitting in your fixture.
Draw three pays 1.4×, and that is earned
Score is a running play total plus 20 for each card that reaches a foundation, then 1000 and a speed bonus on a win. All of it multiplied by 1.4 on Draw 3.
The multiplier is not decoration. Draw 1 deals are close to always winnable — you see every card in the stock, repeatedly. Draw 3 genuinely withholds cards: a given card may be unreachable for an entire pass, and plenty of deals simply cannot be won. Paying the same for both would mean nobody sensible ever picks the harder one.
Abandoning a deal with NEW still reports whatever you had banked, since the site keeps the highest score it is ever sent — so quitting a bad deal costs you nothing you had already earned.
Solitaire is free in a browser, draw one or draw three, no account, no download. Undo works, including the card it flipped.