OpenWorm scientists reverse-engineered the worm Caenorhabditis elegans(C. elegans) neural networks using sensors and software. The result is it actually responded to its environment in the same manner as the biological worm. Stimulation of its nose made it stop moving, while touching a food sensor made it move forward.
The simulation isn’t exact—the program has some simplifications on the thresholds needed to trigger a “neuron” firing, for example. But the behavior is impressive considering that no instructions were programmed into this robot. All it has is a network of connections mimicking those in the brain of a worm.
The experiment is not random and the outcome is the same after repeated attempts.