Skip to content

Repository files navigation

Katamino Tower

Katamino Tower 3D Puzzle Solver

English | 简体中文

Usage

Interactive 3D

open katamino_tower_solver.html

C CLI

# Build (single-thread)
gcc -o katamino_tower_solver katamino_tower_solver.c

# Build (OpenMP multi-thread, macOS)
brew install libomp
gcc -I$(brew --prefix libomp)/include -Xclang -fopenmp \
    -lomp -L$(brew --prefix libomp)/lib \
    -o katamino_tower_solver katamino_tower_solver.c

# Random solve (default, finds a solution within 2000 attempts)
./katamino_tower_solver

# Exhaustive mode: enumerate all ring configurations, count total solutions
# Ring0 rotation fixed=0, total 120×12^4 ≈ 2.5M configurations
./katamino_tower_solver -a

# Exhaustive mode, stop after finding N solutions
./katamino_tower_solver -a -n 10

Rules

Assemble 15 pieces around the central pillar into a complete 5-layer cylinder. Each layer fills 12 columns (30°/column).

ps: The "6+" on the box — seriously? ❓

Algorithm

MRV (Minimum Remaining Values) backtracking search, two-phase solving:

  1. Ring Placement — 5 rings randomly assigned to 5 layers and rotated, determining the columns blocked by ring outer arcs
  2. MRV Backtracking — Precompute all valid pentomino placements, always try the cell with fewest candidates, randomized search order

The outer loop tries up to 2000 random ring configurations, typically finds a solution within 10~200 tries.

Contact

About

katamino tower 3d puzzle solver(百变方块立体塔求解器)

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages