EWASHINGTON
Projects

Cardio

Five solitaire games on a table that moves like a real one.

AndroidPrivate repository

Snapshot

Status
v0.1 released
Platform
Android (minSdk 26)
Distribution
Signed APK via Obtainium
Built with
Kotlin · Jetpack ComposePure-JVM rules engineDataStoreGradle · GitHub Actions
Overview

Cardio is a solitaire app for Android with Klondike, Spider, FreeCell, TriPeaks and Pyramid, all built on one set of rules. It was built to feel like cards on a table rather than a board being redrawn: cards spring into place, flip over properly, and a new deal flies in card by card. It was also built so a game can't be lost by accident. Leave mid-deal and it's still there when you come back.

The games

Each game comes in a few variants. The records are kept separately for each one, and a How to play screen reads its list of variants from the same code the games use, so a new variant can't ship without rules.

Klondike

Draw 1, Draw 3, Draw 3 with three passes, and Relax, where the whole deck is dealt face up.

Spider

One, two or four suits, always with two decks.

FreeCell

Four, two or one free cell, for when four is too forgiving.

TriPeaks

The classic three peaks, with a bonus for long chains.

Pyramid

Three passes through the stock, or only one.

52 Pick Up

Hidden behind the title. Hold to throw the pack, then tap all fifty-two cards up against the clock. Finish it once and the title turns gold.

How it feels

Cards move to their new place with a spring, so moves, undo and the end-of-game sweep all look like motion. Columns always fan out enough to show every card's rank and suit and leave a strip wide enough for a finger, so a run can be picked up from anywhere in the column. By default the deck sits in the bottom corner nearest your thumb, and a Classic setting puts it back in the top row where it would be on a table.

Spring-animated movesReal card flipsForgiving touch targetsLeft-handed layoutFive felt colours

Highlights

  • All the rules live in a plain Kotlin module with no Android code: dealing, moves, foundations, scoring, undo and saving are all tested without an emulator. The app itself only draws cards and handles touch.
  • A board is never changed in place. Every move produces a new one, so undo just goes back one step, and no game needs its own logic for reversing moves.
  • Each game's unfinished deal is saved after every move and again as you leave it, so a stray back gesture or Android closing the app in the background never loses a game. Only giving up throws a deal away.
  • Drawing and touch use the same code to work out where each card is, so what you see and what you can grab never disagree. A grab that lands slightly off picks up the nearest card that can actually move.
  • Wins, streaks and best times are kept for each variant, so a Draw 3 record is never flattered by Draw 1 games. A deal counts from its first move.
  • Relax is its own variant, not a setting. Most of Klondike's difficulty is not knowing the draw order, so with the deck dealt face up it's a different game and gets its own records.
  • Releases are automatic: bumping the version triggers a test run, a signed APK, a tag and a GitHub release. The signing key is checked before building, and each release lists its certificate fingerprint so a key change is easy to spot.