Download for Windows Premium
Publicidade
While-loop
While loop
Vi använder en While-loop för att styra programmet.
We'll use a While loop to control the program.
Huvudloopen hos programmet består av en While-loop med två villkor som ska adresseras.
The main loop of the program consists of a While loop with two conditions to be addressed.
Vi ska nu använda en enkel While-loop som stoppar när ljusintensitetsvärdet är mindre än 1.
Step 5 We are going to use a simple While loop that stops when the brightness value is less than 1.
Om så önskas, lägg till en DispAt-sats till denna While-loop för att visa aktuellt avstånd och se att allt fungerar som det är tänkt.
If desired, add an Output(statement to this While loop to display the current distance to make sure things are working properly.
Steg 4 Vi ska senare använda en While-loop för att titta efter färg- ändringar men först måste vi veta vilken färg som Rover "ser" för tillfället.
Step 4 We will use a While loop to look for a change in color but first we need to know what color the Rover currently 'sees'.
Nedan ser ni ett exempel på en do/while-loop.
The following is an example of a while loop: Code
Não foram achados resultados para esta acepção.
Publicidade

Resultados: 6. Exatos: 6. Tempo de resposta: 10 ms.