All projects
Mobile Android

Slant

A polished Android implementation of the classic logic puzzle Gokigen Naname (Slant). Generate unique puzzles across four difficulty levels, solve them with tap-to-cycle controls, and track your progress with detailed statistics — all fully offline.

KotlinJetpack ComposeClean ArchitectureMVVMHiltRoomCoroutinesCanvasUnion-FindConstraint Solver

Slant is a native Android app for playing Gokigen Naname — a grid-based logic puzzle where you fill every cell with a diagonal line (╲ or ╱) such that the number clues at each intersection are satisfied and no loops are formed.

Puzzle generation

Puzzles are generated on-device using a constraint-propagation solver with backtracking. The generator first builds a random valid solution using a Union-Find structure to guarantee no loops, then strips away clues iteratively — verifying after each removal that exactly one unique solution still exists. Four difficulty levels (5×5 through 12×12) control both grid size and clue density.

Rendering and interaction

The board is drawn entirely on a Compose Canvas — single-surface rendering of grid lines, diagonals, and clue numbers. Tapping a cell cycles through empty → backslash → forward slash → empty. Clue numbers are colour-coded in real time: green when satisfied, red when violated, neutral otherwise. Loop detection runs after every move via Union-Find on the intersection-point graph.

Architecture

Clean Architecture with strict layer separation. The domain layer is pure Kotlin with no Android dependencies — it houses all models, use cases, the solver, and repository interfaces. The data layer implements persistence through Room and contains the puzzle generator. The presentation layer uses MVVM with StateFlow-backed ViewModels, Jetpack Compose for all UI, and Hilt for dependency injection throughout.

Other features

Undo/redo via a fully serializable action-stack, pause mode, hint support (powered by the solver), game timer, move counter, and per-difficulty statistics tracking best and average completion times. Games auto-save when navigating away and can be resumed from the main menu.

Screenshots

Start Menu
Start Menu
Game View
Game View
Game finished
Game finished