The Quaternary Gray Code and How It Can Be Used to Solve Ziggurat and Other Ziggu Puzzles
Madeleine Goertz, Aaron Williams

TL;DR
This paper introduces the Ziggu family of puzzles, encodes their states using quaternary Gray code, and provides efficient algorithms for solving, ranking, and comparing puzzle states, expanding understanding of Gray code applications.
Contribution
It presents the first analysis of Ziggu puzzles using quaternary Gray code, including solution algorithms and a bijection to Nurikabe grids, advancing puzzle encoding methods.
Findings
Shortest Ziggu solution length is $6 imes 2^n - 3n - 5$
Longest Ziggu solution visits all states, following the quaternary Gray code order
Provides $O(n)$ algorithms for ranking, comparison, and successor operations
Abstract
We investigate solutions to the new "Ziggu" family of exponential puzzles. These puzzles have pieces that form mazes. We encode the puzzle state as an quaternary number (base ) with digits, where each digit gives the horizontal or vertical position in one maze. We show that the number of states on a shortest solution is (OEIS A101946). This solution is unique, and it is generated from the start as follows: make the leftmost modification that doesn't undo the previous modification. Replacing "leftmost" with "rightmost" instead generates the unique longest solution that visits all states (OEIS A003462). Thus, Ziggu puzzles can be viewed as -ary, -ary, or -ary puzzles based on how the number of state encodings, valid states, or minimum states grow with each additional maze. Classic Gray code puzzles (e.g., Spin-Out)…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAnimal Diversity and Health Studies · African history and culture analysis · Pharmacological Effects of Medicinal Plants
