Get the latest tech news

Solving a “Layton Puzzle” with Prolog


I have a lot in the works for the this month's Logic for Programmers release. Among other things, I'm completely rewriting the chapter on Logic Programming...

And recently I stumbled into this post by my friend Pablo Meier, where he solves a videogame puzzle with Prolog: This is implicitly verified by score(both lists need to be empty at the same time) but it's a good idea to explicitly add length(Key, 10) as a clause of key/1. The actual examples I'm using in the book are "analyzing a version control commit graph" and "planning a sequence of infrastructure changes", which are somewhat more likely to occur at work than needing to solve a puzzle.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Layton

Layton

Photo of Prolog

Prolog

Photo of layton puzzle

layton puzzle

Related news:

News photo

C Plus Prolog

News photo

The Simplicity of Prolog

News photo

I'm not mutable, I'm partially instantiated