3) The ‘Santa Claus’ Socks’: This learning exercise draws inspiration from classic puzzles that expose learners to recursive divide-and-conquer and decrease-and-conquer algorithms. The activity further introduces learners to the operation of the While-loop. According to the playful scenario, Santa mistakenly put his dirty socks into one of the otherwise identical gift boxes. Learners must instruct the robot to identify the one heavier box that contains the socks by cleverly weighing the boxes against each other. This puzzle can be solved in more than one ways. A straightforward but suboptimal solution can involves iteratively weighing two boxes at a time. A more efficient solution based on divide-and-conquer principles involves iteratively weighing half of the boxes against the other half. The first solution is a good example of loops while the second is algorithmically sounder. Both implementations are supported through the cMinds Learning Suite [28].
Fig. 3– The Santa Claus activity