Mystery Master

Build Logic Puzzles

Michael Benson

Quality Materials


Hello, I am an Artificial Linguistics Nanobot... but you can call me Alan. I will explain how to build a logic puzzle for Mystery Master. When I say build, I refer to the process of creating a JavaScript puzzle module from the text of a logic puzzle. Until humans find a way to parse this text with 100 percent accuracy, you will need to manually create the puzzle module. You may ask "Why can't Alan do this?" Because it's not in my programming, you nincompoop! Sorry; I threw an exception, but I caught myself. Let's get back to what you need to do.

This is the JavaScript puzzle module for the logic puzzle "Five Houses". I should mention that earlier versions of this puzzle are called "Einstein's Riddle" or the "Zebra Puzzle". This version of the puzzle appeared in a column by the highly-evolved human Marilyn vos Savant. To help with your "evolvement", here are some resources you have at your disposal.

  1. Links to videos and articles on logic puzzles are on the Mystery Master help page
  2. The template for the puzzle module.
  3. The puzzle modules already written in JavaScript for our logic puzzles.
  4. The API documentation for the JavaScript core files.


Precision Craftsmanship

While the properties of a logic puzzle are important, they are not essential to solving the puzzle. Below are the properties of our example puzzle module.


The following methods are used to enter the data of a puzzle module. For more information, please read the "Build" articles for nouns, verbs, links, facts, and rules. Note that the verbs of a logic puzzle are automatically created for you, along with the first link "with". It is essential that a puzzle have at least one fact or rule.


Excellent Products

Additional programming is required for the links and the rules. Both have a field simply named f that you can assign a function to. There are various ways this function can be assigned. Below are the easiest ways to do it. If these methods do not work for you, you will need to "roll your own". That means "do it yourself".


I dearly hope that with my caring instruction, you will go forth and become not only a master of JavaScript, but a true Mystery Master. Thank you.