As the robot tests alternative movements, it continuously updates it database of options—having used a computer simulation of itself to create a sort of how-to-walk map ahead of time. Researchers call this testing phase a “simulated childhood,” and it’s a little bit like what a baby does when she’s learning how to crawl. Only the robot takes minutes—not weeks or months—to test and determine the movements that will work best.

This is much faster, the authors say, than previous attempts. And that’s in part because although the robot is sifting through about 13,000 possible movements, they are all options that the robot has already deemed potentially useful. “The space of all possible behaviors that is searched to find these 13,000 high-performing behaviors is unimaginably vast,” they wrote. “In fact, it contains 10^47 possible behaviors, which is about how many atoms make up the planet Earth!”

Researchers experimented with both a hexapod robot and a robotic arm, and they believe their algorithm could be used to enable any kind of robot to adapt to damage and complete a mission. Over the course of hundreds of tests, the six-legged robot was able to adapt to at least six different types of damage—including completely losing two legs—and the robot arm was able to adapt to at least 14 kinds of damage, including having two of its motors broken.

Perhaps all this evokes images of Westworld, or of The Terminator, or at least of an assembly line that never breaks down. A robot that can break and keep going anyway is, after all, a robot that doesn’t need people. Or needs them less than its robot predecessors did, anyway. The potential uses for such machines are incredible to imagine. These things could skitter across Mars, or explore an ocean trench, or crawl over rubble to help search for victims after an earthquake.

Scientists and engineers have been working on perfecting such algorithms for more than a decade. And in 2006, when researchers at Cornell built a robot that could teach itself how to limp, one scientist said the behavior was a form of consciousness. "Whether humans or animals are conscious in a similar way—do we also think in terms of a self-image, and rehearse actions in our head before trying them out—is still an open question," researcher Josh Bongard told the university’s news service at the time. Elsewhere, researchers have designed robots with squishy, self-healing muscles, robotic cubes that can apparently clone themselves, tiny robots that can assemble themselves in the first place, and giant robots that can hurl cinder blocks. The fields of robotics, machine learning, and artificial intelligence are making gains so rapidly it can be hard to keep track.

The work that culminated in Wednesday’s Nature paper began in 2011. The intelligent algorithm at the center of the research turned out to be astonishing even to the people who designed it.