Skip to main content
CS Teaching Tips

Main navigation

  • Browse All Tips
  • Tags
  • 3D
  • About
  • Rate Tips
  • Tip Sheets

Show students examples of infinite loops in Alice using Do-together and Do-in-order blocks with the goal of furthering students’ understanding and recognition of for loops.

Share Show students examples of infinite loops in Alice using Do-together and Do-in-order blocks with the goal of furthering students’ understanding and recognition of for loops. with FacebookShare Show students examples of infinite loops in Alice using Do-together and Do-in-order blocks with the goal of furthering students’ understanding and recognition of for loops. with Twitter
  • Below is sample of an infinite loop using the Do-together and Do-in-order blocks in Alice.
    • In this scenario, an infinite loop must be used because a clock in the room should be continuously animated throughout the scene.
    Do together:
Loop (infinity times) times
(clock.minute) roll (left) (1 revolution)
(clock.hour) roll (left) (0.08 revolutions)
Do in order
(teacher) turn (left) (0.25 revolutions)
(teacher) move (forward) (2 meters)
(teacher) turn (right0 (0.5 revolutions)
(teacher) move (forward) (2 meters)

More about this tip

Tags

  • Other Programming Language
  • Programming Concepts
External Source
Interview with Nigamanth Sridhar
Other Tips By
Other Tips By Nigamanth Sridhar

Similar tips

Use Monopoly, explaining that the game is a class, to demonstrate Java classes and objects in a familiar and interactive way.
Demo visualizations of code executing online, using tools like Python Tutor, and on paper before having students practice visualizing code execution in the same way to better learn how code executes.
Remind students that variable assignment occurs in the order assignments are given. This avoids the misconception that changing one value affects other variables assigned before it.
  • CSTT Facebook
  • CSTT Twitter

For more information or to report a bug, contact us at admin@csteachingtips.org. Built with Bootstrap. Footer Icons by Mohammed Alyousfi. Powered by Drupal.

Privacy Policy

  • National Science Foundation
  • Sage Fox Group
  • Harvey Mudd College