"Cheats" Version of The Ladybug Game
 
This is a modified version of Ken Perlin's Ladybug Game. Copyright 2001 by Ken Perlin. We really like Ken's beautiful applet and think (especially dad) that the running version and its code provide a rare, clear and complete example of the clever use of various math concepts to program computer graphics, or as Ken describes it "drawing with math." He has many other fascinating applets on his website that are must sees. (Visit: http://mrl.nyu.edu/~perlin/)

In the original game the goal is only to light up all the tiles. Though it is possible to do this without creating a complete path, i.e. a continuous path that goes through every tile, it is more interesting to create a  complete path, since then either

1. the complete path has two ends that terminate at two places on the four sides of the game board, and so all the tiles light up every time the ladybug traverses the path from one end to the other, or

2. the complete path is a closed loop, and so all the tiles light up and stay on forever.

We will call a solution that creates a complete path a persistent solution, since in each case the solution persists (as described above), and since each complete path solution is more easily identifiable and reproducible.

Game Goal:  Find a complete path (persistent) solution to the Ladybug Game.

My kids and I were intrigued by this version of the ladybug game and like all good modern gamers we decided that it would have been nice to have had "cheats" along the lines of the way we first solved the puzzle. Here's the modified version of the applet, and below it are the instructions for using the applet.

 
 
The ladybugCheats Applet 

The current "cheats" version of Ken's Ladybug Applet was created to aid us in our exploration of this type of puzzle with Game Goal as described above.

 Features (Cheats)

1. Tile numbers are displayed on each tile as in the 15 puzzle. Also, the ladybug does not initially appear on the game board (see 5. below).

2. Any tile on the board can be moved (click on it) to the empty square, without having to be adjacent to the empty square.

3. If the empty square is returned to its standard position in the lower right-hand corner after a sequence of moves as in 2., then the inversion sum for the resultant configuration (w.r.t. the original configuration) is displayed on the empty square. Note that the inversion sum must be even for any solution reachable from the original configuration. If the inversion sum is odd then although there may be a complete path that goes through every tile, it won't be reachable from the original configuration of the game (playing by the rules).

4. If the mouse is dragged over the empty square when it is in standard position as in 3., then the tiles are all returned to their initial configuration at the beginning of the game.

5. If the mouse is dragged over the empty square when it is anywhere except standard position, then both the initial configuration is re-instated and the ladybug returns to the game board. Instead of the tiles lighting up as she moves and visits a tile, each tile number lights up and so does each curve  that she visits on each tile.

John & kids Summer 2002