Build PHP Puzzle Parts | ![]() |
---|
This metawork article explains how I build the PHP files for each part of a logic puzzle.
For puzzles that have an associated JavaScript module, there are additional pages (the puzzle parts) that are generated. These pages are in two subfolders under the help folder: the puzzle folder (before the puzzle was solved), and the solved folder (after the puzzle was solved). The pages in each folder have the same name as the puzzle. The links along the bottom of the page are given below.
The JavaScript build-puzzle-parts.mjs builds the puzzle part files for one or all puzzles that have a JavaScript module. For this to work the Viewer.js module requires the Filer.js module in the server folder. The line in the Viewer module that does this is:
const Filer = require("../server/Filer.js");
To have build-puzzle-parts.mjs
invoke just one puzzle, set puzzleName
to the name of the puzzle. Otherwise, set puzzleName
to the empty string.
The files before the puzzle is solved are in subfolders under the help/puzzle
folder. The files after the puzzle is solved are in subfolders under the help/solved
folder. Some of these files show up as links on the puzzle page.
puzzle: chart, facts, grids, links, nouns, rules, verbs.
solved: chart, facts, grids, marks, nouns, rules, stats.
Here are the steps to generate the PHP puzzle part files.
cd /projects/mysterymaster.com/metawork/js/server
node build-puzzle-parts.mjs