In the previous chapters, you used the if-then-else
control block several times. The if then else block enables apps to make decisions. It is one of the fundamental computing concepts that is present in any programming language. There is a second fundamental programming concept—the loop, which we will explore in this chapter. A loop allows a program to repeat code. More specifically, in App Inventor, a loop will let us execute a stack of blocks multiple times.
To illustrate the concept of a loop, we will create a digital raffle App in this chapter. In case you aren't familiar with a regular (nondigital) raffle, we will explain. A raffle organizer gives participants a ticket with a number on it and puts a duplicate of that ticket in a bowl. When all the tickets have been given out (and put in the bowl), the raffle organizer then randomly picks a ticket out of the bowl (often times with a blindfold on) and announces the winning ticket number...