1 of 5

Repeat Loops, Part II

Thunkable

DragAndDropCode.com, David Wolber

2 of 5

Repeat While

  • “repeat while” is the most flexible repeat loop block -- you can do anything with it.

Repeat blocks inside “do” while condition remains true (0 or more times)

Some boolean condition

DragAndDropCode.com, David Wolber

3 of 5

Trace the following code

What is the value of “number” and “total” after each iteration?

DragAndDropCode.com, David Wolber

4 of 5

Repeat Loops Similar to Slideshow

“number” is the index, incrementing, comparing to limit

DragAndDropCode.com, David Wolber

5 of 5

Demo: Add up a List with “Repeat While”

Add up a List with “for each item in list”:

DragAndDropCode.com, David Wolber