Random Robot

 

Why does this code work?

3 part robot