KMPCardGames project icon

Solitaire & FreeCell (KMP)

One Kotlin codebase ships the same game to Android, iOS, web, and desktop JVM—shared rules and tests in one module, with a lightweight KorGE client on top.

This repository is a Kotlin Multiplatform example: Solitaire and FreeCell rules live in a shared module with common tests, and a small real-time KorGE shell runs the shared rules in a real client on each platform: Android, desktop JVM, web, and iOS. The focus is consistent domain code, per-platform input and rendering, and multi-target Gradle packaging, not game-industry scope.

Kotlin in the shared layer

~98% of app code; ~105 lines platform-only

Automated tests on shared rules

11 test files · 32 @Test cases

Figures measured 2026-04-15. Tests live in the shared module’s commonTest source set (Gradle/KMP)—same tests back JVM, Android, and other linked targets. Breakdown and counting notes are in the repo README.

CI status

CI status badge

Solitaire Interactive Demo - FreeCell Coming Soon

What lives in shared code

  • Models for cards, piles, overall game state, and which variant rules apply
  • Player actions, validation, and accepted or rejected move results
  • Solitaire and FreeCell rule sets plus shared rule plumbing
  • Session management, deterministic state updates, undo and redo, and game factories
  • Read models so UIs can render without reaching into rule internals

Why Kotlin Multiplatform fits this project

  • One implementation of the rules, shipped to web, desktop JVM, Android, and iOS from the same project
  • Tests in common source exercise the same paths every client links against
  • A clear boundary: KorGE stays in the client module; the domain stays plain Kotlin
  • A small real-time client doubles as a stress test for shared state and multi-target builds
2026Kotlin MultiplatformKotlinKorGEGradle