A Double-Ended Spam Cruncher (DESC) is an artificial life form that lives on a square grid and moves around looking for its favorite food, spam. The DESC grows one square longer every time it crunches spam.
A DESC has two heads, one at each end. Therefore, it can move either forwards or backwards.
In the applet above, the DESC appears as either a green snake (computer control) or a magenta snake (human control). Pink circles indicate spam, and blue squares indicate walls.
The left menu selects mode. The center menu selects the map, and the right menu selects the delay between time steps.
Pressing N at any time will restart with the current settings. Pressing P will pause or unpause.
The DESC is computer-controlled, and uses a greedy movement algorithm that always goes for the nearest spam. When searching for a path to spam, the computer takes into account the movement of the DESC, and will plot a path that crosses over the DESC's current position, provided that the DESC's tail will move out of the way before the head reaches that point in the path. This makes the DESC slightly less likely to be trapped.
It turns out that this means that if the head can find a valid path to the tail, the head will be able to follow the tail around the map indefinitely and reach any position that is theoretically reachable.
You can switch between greedy, construction, and drive modes without restarting the current map; state will be preserved.
While in construction mode, the DESC remains under computer control and uses the greedy algorithm. However, the user may add and remove spam from the grid by left-clicking, and may also add and remove walls by right-clicking.
If you wish to prevent the DESC from moving while you edit the map, press P to pause the game, finish editing, and then press P again to unpause.
You can switch between greedy, construction, and drive modes without restarting the current map; state will be preserved.
In drive mode, the DESC is under human control. Use the arrow keys to steer the DESC and use the space bar to reverse direction (the DESC will move continuously without directions unless it is blocked or you pause).
Pressing A will switch to relative control mode. While in relative control mode, the left and right arrows will cause the DESC to turn. The up arrow will cancel a turn if you press it before the DESC responds to the left or right arrow. Pressing A again will switch back to absolute control mode.
You can switch between greedy, construction, and drive modes without restarting the current map; state will be preserved.
In race mode, two identical maps will appear side by side. On the left map, a computer-controlled DESC will move around under the greedy algorithm. On the right map, there is a DESC under human control. Both DESCs move at the same speed. Try to crunch all the spam on your grid before the computer finishes!
Switching into or out of race mode will automatically restart; you cannot preserve the map state from another mode.
In VS mode, a DESC under computer control and a DESC under human control both appear on the same grid, starting in opposite corners. Try to crunch more spam than the computer!
Note that the computer is still usin the greedy algorithm and does not cope well with moving obstacles. The best strategy is probably to crunch some spam to increase your length, and then quickly get in the computer's way so that it cannot get to spam easily.
Switching into or out of VS mode will automatically restart; you cannot preserve the map state from another mode.
In older versions of Netscape (i.e. on computers in the lab) you will need to click somewhere in the window after making a selection from one of the applet's menus, or the browser will fail to recognize your key strokes (and you won't be able to control the DESC).
The applet also sometimes seems to run appallingly slow on the lab computers. It seems to improve somewhat if you close down other applications.
Questions, comments, etc. should be directed to Jeremy Lennert.