puzzle experiments and experimental puzzling
blog logic puzzles piward coding rec-math the-bonfire
github profile
β•­ πŸ›πŸ˜Β· My CSP solver is currently working for these puzzle types: Slitherlink Sudoku Shikaku Calcudoku Pure Loop Masyu Minesweeper
β”Š
β”Š πŸ›πŸ˜Β· I've been using the book Brain Training the Japanese Way prolific puzzle book author Dr. Gareth Moore. There are 16 different types of logic pencil puzzles with 12
β”Š puzzles of each in increasing size and difficulty. My solver is sometimes slow, but now handles all 12 Shikaku puzzles from β€˜BTJW’.
β”Š
𝕁 β”Š 𝟚𝟟· One project I've been working on a while is Sapphire, the top level of my β€˜language stack’. The intent is to learn about Symbolic Logic with programming, and I
𝕦 β”Š started it now years ago when I was doing the exercises in Mathematical Logic through Python and started up my own version with Unicode operators like β€˜β‡’β€™, β€˜βˆ§β€™ and
π•Ÿ β”Š β€˜βˆ¨β€™.
𝕖 β”Š
β”Š Currently, I can describe simple, finite Constraint Satisfaction Problems and I've been working on a solver that mixes symbolic operations with constraint propogation
β”Š over variables of finite domain. It can solve 9x9 Sudoku and small Slitherlink puzzles, as well as a few others, but it's still a kludge.
β”Š
β”Š I support much of the same syntax in my Python based language I've implemented the solver in, but I'm not breezing through optimization. I'm working on getting things
β•° down to the C level while playing around with all the rest of it.
𝟯 / 𝟚𝟝· 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).