Programmable matter is the idea behind creating a large number of very small robots that can reorganize themselves into different shapes. It was perhaps most famously depicted in the movie Big Hero 6, with the main character's Microbots:

There have been a bunch of attempts from different research groups to try to work towards this goal. One of my favorite are the Robot Pebbles from Gilpin and Rus, which are small cubes that have electropermanent magnets on their faces:

Probably the most advanced are the M-Blocks from the same research group at MIT, that use a series of internal fly wheels that they quickly break to generate motion:
Hackaday.io had an interesting attempt a number of years ago by Harry Svensson to make a fully-mechanical version of programmable matter:
I've been interested in this sort of "low resolution programmable matter" -- the idea of relatively large cubes that are (ideally) much easier to design and build -- for some years, but I've not really had any time to start experimenting in the area, and most of the ideas I tend to have seem like they'd have large technical hurdles to overcome. In this project, I make a first attempt using a somewhat ridiculous idea I had where each cube can essentially lift itself up overtop of neighbouring cubes by extending a large telescopic actuator from below, then sliding itself over:

peter jansen
David Troetschel
finallyfunctional
Where did you buy those blue plastic profile beams?