In an attempt to throw the authorities off his trail, Kaz Kylheku <k...@ashi.footprints.net> transmitted:
> In article <ak7h1k$7c...@lacerta.tiscalinet.it>, CheTeFreGa wrote: >> i want to develop a lisp pure recursive program (no iteration and >> no assignment) to find the shortest path in a labyrinth! someone as >> same idea?
> Pour water into the maze at the starting point, and remove water at > the termination point. When the flow stabilizes, start adding dye to > the incoming water. The paths will become obvious, since they are > the only ones with live flow; all the dead ends become stillwater, > into which the dye can only travel by slow diffusion. The shortest > paths will be the ones that are dyed first; when the first trace of > dye hits the termination point, be sure to snap a photograph.
You could probably program that using a computational array, with a cell for each location in the maze, each having a directional pressure metric.
You add a unit of water at the start point, and then go through a number of generations of evolution of the system, letting the pressure propagate from cell to cell, and watch the water flow. Once the system stabilizes, so that for every unit of water introduced, one flows out, you can then introduce one more unit of water, and follow it to wherever it goes, which will be the shortest path.
Coding it as a simulation of an analog computer would _surely_ be worth extra credit... -- (reverse (concatenate 'string "moc.enworbbc@" "sirhc")) http://www.ntlug.org/~cbbrowne/sgml.html "I have stopped reading Stephen King novels. Now I just read C code instead." -- Richard A. O'Keefe