My program is suppose to move the turtle until it reaches 30,000 steps. I'm confused as to how to use while loop. I know it's wrong, I'm just lost on the steps, basically how to set up the while loop.
#include <iostream>
#include <PCTurtle.h>
using namespace std;
So, for each iteration of the loop, the turtle is supposed to move forward 'i' number of steps, pause, and then rotate to the left by 90 degrees. Am I understanding this correctly?
1 2 3 4 5 6 7 8 9 10 11 12
constint max_distance = 30000;
int distance_travelled = 0;
int iteration = 0;
while (distance_travelled < max_distance) {
iteration++;
PenForward(iteration);
distance_travelled += iteration;
Pause(0.01);
TurnLeft(90);
}