Learn Create Your Own Split Screen

Next Page

There's a subtle difference between the Scratch repeat block and the Javascript while loop that may have been causing some slight disorientation.
Consider the following instructions in English:

  Keep pouring water
  until the glass is full
  While the glass is full
  keep pouring water

Obviously the one on the right results in water all over the bench.


The one on the left is like a Scratch repeat. The one on the right is like a Javascript while.

The difference between them just means you need to phrase things differently:

  Keep pouring water
  until the glass is full
  While the glass is not full
  keep pouring water