if(dist_f>=25)
{
a:
motion('f',180,135,t);
dist_135=sonar();
front_motion(t);
motion('f',135,90,t);
dist_f=sonar();
front_motion(t);
motion('f',90,45,t);
dist_45=sonar();
front_motion(t);
motion('f',45,0,t);
dist_r=sonar();
front_motion(t);
motion('f',0,45,t);
dist_45=sonar();
front_motion(t);
motion('f',45,90,t);
dist_f=sonar();
front_motion(t);
motion('f',90,135,t);
dist_135=sonar();
front_motion(t);
motion('f',135,180,t);
dist_l=sonar();
front_motion(t);
if (dist_f>=25)
goto a;
}
This should be a while loop, so you can loose the silly goto.
Some arrays and for loops() would greatly shorted the code.