Presentation is loading. Please wait.

Presentation is loading. Please wait.

Repetition loops Is a condition true? START END OF LOOP EXIT.

Similar presentations


Presentation on theme: "Repetition loops Is a condition true? START END OF LOOP EXIT."— Presentation transcript:

1 Repetition loops Is a condition true? START END OF LOOP EXIT

2 In Turing loop put "Hello" end loop

3 loop put "Hello“ delay(500) end loop

4 Start a counter at 1 1.Print the counter 2.Add 1 to the counter 3.If the counter is 100.. exit 4.Go to step 1 Count to 100

5 var counter:int counter := 1 loop put counter counter :=counter + 1 end loop Count to 100

6 var counter:int counter := 1 loop put counter counter :=counter + 1 exit when counter =100 end loop Count to 100

7 var counter:int counter := 1 loop put “Stewart” counter :=counter + 1 exit when counter =1000 end loop Print your name 1000 times

8 var counter,num:int counter := 1 loop randint(num,1,100) put num counter :=counter + 1 exit when counter =50 end loop Print 50 random numbers

9 var counter,x,y:int counter := 1 loop randint(x,1,640) randint(y,1,480) drawfilloval(x,y,5,5,red) counter :=counter + 1 exit when counter =50 end loop Create 100 circles on the screen

10 var radius : int radius := 10 loop drawoval (100, 100, radius, radius, blue) delay (80) rad := rad + 5 exit when rad = 100 end loop Create an “explosion”

11 var radius : int radius := 10 loop drawoval (100, 100, radius, radius, blue) delay (80) rad := rad + 5 exit when rad = 100 end loop Create an “explosion”


Download ppt "Repetition loops Is a condition true? START END OF LOOP EXIT."

Similar presentations


Ads by Google