Thread: the main code
View Single Post
  #2   Spotlight this post!  
Unread 09-01-2008, 14:18
Roger Roger is offline
Registered User
FRC #1153
 
Join Date: Jan 2006
Rookie Year: 1900
Location: Walpole MA
Posts: 685
Roger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond repute
Re: the main code

The while loop continues to loop while the condition in the () remains true. It is checked at the beginning of the loop. (There is another kind of while loop that checks at the end of the loop.)

So a while(true) -- or a while(1) -- or a while (1==1) -- continues forever until an outside condition stops it, such as the field gets turned off at the end of a match, or something inside the loop jumps out of the loop (not likely). It's a simple way of letting your code run forever until you turn it off.