Skip to content
Your progress

Checking your sign-in…

Who's learning?

Each profile keeps its own read lessons, badges, streak, and practice scores on this device.

Lesson 5 of 9

Test the tricky case

Show on a big screen

6 min

Text size

Your rule: give one sweet to each friend, again and again. Stop when no sweets are left. You try it with 3 friends and 13 sweets. It works. Is the rule done?

Loading lab…

No. Try zero friends. Nobody can take a sweet, so the rule never stops.

Give 1 sweet to each friend, round and round.
Step 1 of 4
  1. Give 1 sweet to each friend, round and round.
  2. With 3 friends, it finishes — 13 shared out.
  3. With 0 friends, nobody is there to give to.
  4. The same rule now never stops by itself.

A rule that works once can fail on another case.

So test a tricky case too. Try zero, the biggest number or the smallest.

Try the lab to finish this lesson.