finds.dev

MohamedRejeb/ChessGameKmp

Kotlin Design Patterns & Best Practices - Part 1: Chess Game

View on GitHub

★ 25Kotlinupdated Jul 2024

// the take

A Kotlin Multiplatform chess game built with Compose Multiplatform, targeting Android, iOS, desktop, and Wasm. It's a teaching project — the point is the design patterns (factory method, builder, DSLs for piece movement), not shipping a production chess app. Aimed at Kotlin developers who want to see pattern usage in a real-ish problem domain.

The movement DSL is the interesting bit — modeling piece movement as a builder with diagonal/straight primitives is a cleaner abstraction than the usual giant if-else blocks you see in hobby chess implementations. KMP + Compose Multiplatform for all four targets from one codebase is genuinely useful to see working. The piece hierarchy (abstract Piece with concrete subclasses) is a textbook but honest application of inheritance where inheritance actually fits. SVG assets in commonMain means the UI layer is fully shared too, not just logic.

Chess rules are nowhere near complete — no en passant, no castling, no pawn promotion, no check/checkmate detection beyond what WinCheckHelper suggests. Tests cover only PawnTest, so the TDD claim in the README is aspirational. No AI opponent and no network play means you need two humans on one device, which limits how much you can actually play with it. Last commit July 2024 and zero forks suggests this is a finished tutorial artifact, not an evolving project.

We read the README, the directory tree and a key source file in June 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
25
Forks
0
Language
Kotlin
Last commit
22 Jul 2024

// nearby

If ChessGameKmp isn't quite it.

All repos →