This is the simple code that I was practicing on since I'm totally new to Java. This is under the Day8 component of the kilobot tutorial available online here: http://www.kilobolt.com/day-8-looping
public class Looping {
public static void main(String args[]) {
boolean EarthIsSpinning = false;
int counter = 9;
while(counter >= 1){
counter--;
System.out.println(counter);
if (counter == 4){
EarthIsSpinning = true;
}
else{
EarthIsSpinning = false;
}
while (EarthIsSpinning){
System.out.println("The earth is still spinning");
}
}
}
And I edited the supposed tutorial that I was supposed to do. so I was wondering why the console keeps looping "The earth is still spinning" and not only that at 4 where EarthIsSpinning = True, since EarthIsSpinning is only true when counter is at 4.