puzzle experiments and experimental puzzling
blog logic puzzles piward coding rec-math
github profile
๐Ÿฏ / ๐Ÿš๐Ÿยท I usually start checking for updates on Raf Peeters Smart Games puzzle design site in January, but I just got around to checking it out after finding IQ Quub and IQ
โ”Š Flow in Eureka Puzzles.
โ”Š
โ•ฐ At the beginning of every year, previews and design discussions are posted of fantastic new challenges to work through and add to your collection!
โ•ญ ๐Ÿš๐Ÿžยท Using summation for Slitherlink and Killer Sudoku is a natural choice, but Peano's Axioms are insufficient to define the integers using only first order logic. I want
โ”Š to dig into the theoretical concerns, but I'm going to defer them for now while I try to get some functionality working.
โ”Š
โ”Š ๐Ÿš๐Ÿยท I'm a focused on solving logic pencil puzzles as Constraint Satisfaction Problems in part because I'd like to try my hand at a puzzle generator. Perhaps my ambition
โ”Š to share a monthly or even weekly sheet of puzzles at my local puzzle & game store is misguided, but for now it's on my hopes and dreams list.
โ”Š
โ”Š ๐Ÿ™๐Ÿžยท To even solve the trivial Slitherlink Puzzle (a 1ร—1 puzzle with a single โ€˜4โ€™) semi-symbolically, I'm going to have to up my constraint handling. My plan was to
โ”Š support constraint expressions - special objects which give some information about an otherwise indeterminate value.
โ”Š
โ”Š My choice was to wrap a logical formula (another expression) using the variable โ€˜_โ€™ to represent the constraint expression. This could get unweildy, so in practice I
โ”Š have kept them simple enough to be useful for my current, puzzle-solving purposes.
๐• โ”Š
๐•’ โ”Š As an example, if x is โ€˜_โˆˆ{1 2}โ€™ and y is โ€˜_โˆˆ{2 7}โ€™ we can deduce โ€˜x+yโ€™ will satisfy the constraint โ€˜_โˆˆ{3 4 8 9}โ€™and we could also deduce from โ€˜x=yโ€™ that โ€˜x=y=2โ€™. The
๐•Ÿ โ”Š pigeonholer I implemented to solve Sudoku puzzles in โŸชSilverโŸซ starts with โ€˜_โˆˆ{1โ‹ฏ9}โ€™ for blank squares and 27 9-way not-equal expressions using an n-ary โ€˜ยฌ=โ€™ operator.
๐•ฆ โ”Š The handling is not Sudoku specific - I'm hoping it will work for a few more puzzles before I tidy things up.
๐•’ โ”Š
๐•ฃ โ”Š Which brings me back to the start - I didn't implement constraint expressions properly, and now that I'm counting the number of edges around a square that are on the
๐•ช โ”Š path, I have to do at least some tidying.
โ”Š
โ”Š ๐Ÿ™๐Ÿšยท puzzles The paper โ€œMathematical Definition and Systematization of Puzzle Rulesโ€ by Itsuki Maeda and Yasuhiro Inoue details a mathematical framework for logic pencil
โ”Š puzzles with formulas defining 10 different puzzle types. Nikoli, the company that popularized โ€œNumber Placeโ€ puzzles under the Japanese trademark โ€˜Sudokuโ€™, publishes
โ”Š collections in Japan and describes each on their website:
โ”Š
โ”Š Slitherlink Sudoku Shikaku Choco Banana Inshi no Heya Fillomino Kurotto Sukoro Norinori Hitori.
โ”Š
โ”Š As I get my โŸชSilverโŸซ Solver working on each, I'll post my โŸชSapphireโŸซ definitions.
โ”Š
โ”Š ๐Ÿ˜๐Ÿยท I started on a formulation of Slitherlink rules in โŸชSapphireโŸซ. Connectivity, as a pairwise relation could be easily satisfied by being true for any vertices that are
โ”Š connected to anything. I ended up defining a distance function with a special value (rather than a distinct relation) for โ€˜not connectedโ€™. In the next day or two,
โ•ฐ I'll see how โŸชSilverโŸซ does trying to find a satisfying model (aka solution).
1 ๐Ÿฎ ๐Ÿ™๐Ÿกยท Here's a link to the Sudoku rules I'm using for my experiments, written in my Sapphire logic syntax. So far, Sapphire supports first order formulae, integer
โ•ฐ operations and sets of integers. My ad-hoc "Silver Solver" supports partial evaluation and rewriting to try to find a satisfying model.
๐Ÿต / ๐Ÿ˜๐Ÿ™ยท Square Routes playtesting is just about happening!
playtesting