Mystery Master

Build Verbs

Michael Benson

Quality Materials


This help article discusses how the verbs of a logic puzzle are defined in a JavaScript puzzle module. The verbs are automatically created by Mystery Master, and they are assigned to three global variables. Here is the JavaScript code that creates the verbs.

	let IsNot = new Verb(-1, "is not", "X");
	let Maybe = new Verb(0, "may be", " ");
	let Is = new Verb(1, "is", "O");

Note: Though globals should usually be avoided for most programming languages, I think defining the verbs as global variables in JavaScript is better than the alternatives.

In the puzzle module, you should not create the verbs, but you can modify the name and/or character used by the verb. For some puzzles, you may want to use the past tense for the names of the verbs.

Here is an example from the puzzle module for the logic puzzle "All Tired Out".

Precision Craftsmanship = "was not"; = "was";

To be consistent, you should not change the characters of the verbs. But if you want to experiment, try changing the character for Maybe from a blank to a question mark. Here is how you would do it.

	Maybe.code = "?";

Three-Valued Logic

While boolean values are either true or false, three verbs are needed to represent the three-valued logic needed in the Grids form.

To transmogrify Wikipedia, "Each verb has one of three values: −1 (False), 0 (Unknown), or +1 (True)".

The following summarizes the three verb variables.

Excellent Products
	The negative verb with value -1 and code "X" is represented by IsNot
	The possible verb with value  0 and code " " is represented by Maybe
	The positive verb with value +1 and code "O" is represented by Is


This article is part of the "Build Logic Puzzles" series. The next article in the series is "Build Links". Thank you.