This post is about yet another small number puzzle, and the corresponding solver for it in Prolog. The post and code is written to be easily understandable and help learn the basics of "think and code" in Prolog.
Tag: solution
Einstein Riddle/Zebra Puzzle in Prolog
In this post we solve another logic puzzle deriving rules from the puzzle and stating them in Prolog. And this time it is a rather famous puzzle one: the Zebra puzzle (also called Einstein riddle/puzzle).
Repair PDFLaTeX generated pdf using GhostScript (Adobe Acrobat Reader error 131)
I tend to do presentations using LaTeX and Beamer, while working on Linux and using TeXLive as LaTeX distribution - which all work fine. But sometimes I need to share these PDFLaTeX compiled presentations with people using Windows and Adobe Acrobat Reader as their pdf viewer. The feedback I usually get back: your pdf is broken, error 131. And frankly, that seems to be true.
Solving Logic Puzzles in Prolog: Puzzle 3 of 3
There are four researchers: Ainsley, Madeline, Sophie and Theodore. The goal is to find out their sports competition discipline, birth year and research interests (while knowing that each of the mentioned attributes is different amongst them). In order so solve the puzzle, a couple of hints is provided from which the solution can be derived.
Solving Logic Puzzles in Prolog: Puzzle 2 of 3
Eilen, Ada, Verena and Jenny participated in a painting competition. Find out who painted which subject and who took which place in the competition, using the hints provided.
Solving Logic Puzzles in Prolog: Puzzle 1 of 3
There are 4 students: Carrie, Erma, Ora und Tracy. Each has one scholarship and one major subject they study. The goal is to find out which student has which scholarship and studies which subject (with all scholarships and majors being different from each other) from the hints provided.
Hidoku Solver in Python: branch cutting, intelligent successor generation and some simplifications
In this post we are implementing a Hidoku solver (Hidoku is yet another fine number puzzle) that uses a depth first search, branch cutting, limited (intelligent) successor generation and some automatic simplification. Usually, a Hidoku is a quadratic board consisting of n x n fields - but rectangular or other forms would be possible as well. With each Hidoku, some fields are already pre-filled with numbers at the beginning. The game goal is to fill in all other numbers so that an ascending number queue is built: each number has to be adjacent to it's successor, with adjacent meaning in an adjacent horizontal, vertical or diagonal field.
Magic number board puzzle solver in Python
The magic number board puzzle is yet another equation puzzle (similar to the first equation puzzle or Jodici) - but has a notable larger solution space. The magic number board is a quadratic board, consisting of 5x5 = 25 fields, which are organized as 5 horizontal rows and 5 vertical columns. Each field should contain … Continue reading Magic number board puzzle solver in Python
Flower disk rotation puzzle solver: Python vs Prolog
The flower disk rotation puzzle consists of 4 wooden, stacked disks. The disks are connected at their center via a pole, so that they can be rotated. Each disk contains holes that are arranged around the disk center in the form of a flower. The holes are uniformly spread, so that there is space for 12 holes - but each disk only has 9 of these 12 possible holes (the position of holes differ per disk). The remaining 3 areas are instead made of solid wood. The goal is to rotate the disks so that all holes are covered by at least one of the disks (as we have a total amount of 4*3=12 solid areas for a total of 12 holes, each solid area must cover exactly one hole).
The RushHour Puzzle – an Artificial Intelligence Toy Problem
What's the RushHour Puzzle about? The RushHour puzzle is a sliding block puzzle and one of the toy problems of Artificial Intelligence. It's about moving cars on a game board, that are stuck in traffic, so that the main car can exit the traffic. Each car can only move forward/backward on it's lane. You probably … Continue reading The RushHour Puzzle – an Artificial Intelligence Toy Problem





