'MacGyver'-like robot can build own tools by assessing form, function of supplies