Learning distributed algorithms by programming robots