Program 3: A light bulb goes on and off.

This example uses the repeat forever construction: it allows a light bulb to change its on-off state every 1 sec.

image004

Program 3

A forever loop in Scratch allows one to watch certain actions for as long as one wants.  For most computations and in other languages, infinite loops are not desirable. They signal that something is wrong with the program. It can be a simple mistake like not increasing a variable as intended or a more serious error in the logic underlying the program. More discussion on infinite loops is in the Misconceptions and Challenges postVideo Length: 2:32