finds.dev← search

// the find

MohamedRejeb/ChessGameKmp

★ 25 · Kotlin · updated Jul 2024

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

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.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →