The example above uses sequential code, repetition, and selection to make the magic 8 ball operate. The loop allows the magic 8 ball to operate continuously while the conditional statements allow different responses to be chosen randomly. Having students create and alter code of this nature corresponds with Mathematics Grade 6 C3.1, 3.2, D2.1 , 2.2