Researchers at Cornell University have developed a robot which can adapt to injury. Most robots fail completely if something goes wrong, but this robot uses software to keep moving if, say, a limb is shortened or disabled. The robot maintains a computer model of itself which is adapted when its body or environment changes. Once an existing model no longer fits its ability to move the computer generates hundreds of new ones at random to test against the robot's last known physical movements. The computer calculates which new physical movements would be most effective and uses those. It's all very clever and much better than the solution I came up with for an injured robot: throwing it out the window while screaming obscenities at science.