//while(S / 2 + offset - 50 < S)
// S / 2 - initial x coordinate of the robot
// d = 50 - value defining size of the robot
while(offset < S - S / 2 + 50)
{
// 1. Clear our drawing canvas
clearviewport();
// 4. calculations
// can be here or at the beginning of this loop
offset = offset + 1;
}
return EXIT_SUCCESS;
}
//----------------------------------------------------------
//----------------------------------------------------------
void draw_robot(int x, int y, int d)
{
setfillstyle(WIDE_DOT_FILL, GREEN); // sets fill style & color
bar(x-d, y-d, x+d, y+d); // draws robot body
circle(x, y-2*d, d); // draws robot head
line(x - d, y + 3 * d, x, y + d); // left leg
line(x + d, y + 3 * d, x, y + d); // right leg
}
//----------------------------------------------------------