Skip to content
Exit presentation

Computational Thinking Basics

Test the tricky case

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.

Jump to lesson

This track

  1. 0 Start here
  2. 1 Split the big job
  3. 2 Spot the repeat
  4. 3 Algorithm = exact steps, in order
  5. 4 Follow the steps exactly
  6. 5 Test the tricky case
  7. 6 Sorting is an algorithm too
  8. 7 The big picture
  9. 8 Track quiz

Other tracks