Plank Puzzles - An Introduction

Clickmazes.com

A long while ago, I discovered the above site, and I was greatly intrigued by all its wonderful plank puzzles (and much more!). However, all the mazes on the site are powered by Java Applets, which unfortunately have become out of favor with web standards and are almost impossible to run these days. However, I still love these puzzles, so I decided to re-implement the applet using HTML5 and JavaScript to (hopefully) give these puzzles some new life.

Plank puzzle concept and maze designs were originally conceived by Andrea Gilbert. The original JAVA applet was programmed by Graham Rogers. My HTML5 implementation copies that design, though 100% of the code here is my own.

To play: use your mouse to pick up and drop the planks to navigate across the screen from left to right. You can only pick up planks connected to where you are (highlighted in yellow), and you can only place planks into gaps that are the same size.

The following puzzles can be downloaded online from Think Fun.

About the implementation: notable differences between HTML5 and Java versions

Embedding the puzzles in webpages

The plank puzzle window is easily embedded as a block element in any web page using the following html

	<x-plank-puzzle-window height='450' width='450'></x-plank-puzzle-window>

The height and width attributes specify the height and width of the rectangle used to render the puzzle and controls. They can be set to any value, although for best results, it should be a reasonably large rectangle; bigger is better.

To specify the puzzle(s), add x-plank-puzzle elements inside the x-plank-puzzle-window

	<x-plank-puzzle-window height='450' width='450'>
<x-plank-puzzle name='Puzzle Name' fmt='1' positions="###" nodes='###'></x-plank-puzzle> </x-plank-puzzle-window>

The HTML 5 implementation is based from and designed to be interchangeable with the "Plank format 1" of the older Java applet; the "positions" and "nodes" attributes are the same values given

Both custom elements depend on two HTML linkable files: plankpuzzles.css and plankpuzzles.js. In order for the puzzles to successfully load, the javaScript file must either be included below all instances of x-plank-puzzle-window or the function PlankPuzzles.appInitialize() must be called after the HTML body has loaded.