Developed and simulated a randomly scattered collective of robots with sensors to self-assemble into any given connected shape, using gradient information derived from the desired shape.