<< Chapter < Page Chapter >> Page >

The second program uses a forever block in conjunction with an embedded if block and a counter variable to create a counter loop. That program was used as the jumping-off point for a discussion of thesimilarities and differences between a forever/if block combination and a repeat block.

The third program uses a repeat until block to cause a sprite to run in a small circle until the user pressesthe space bar. I pointed out that unlike the forever block, it is possible to connect another block to the bottom of a repeat until block. Therefore, it is not necessary for a repeat until block to be the last block in a script.

Finally, I provided the specifications for a student-programming project for you to demonstrate your understanding of what you learned from the threeprograms listed above and from earlier modules.

What's next?

One of the new features of Scratch v2.0 is the ability for you to create your own blocks. The next module will discuss that feature.

Resources

General resources

Programs used in this series

Miscellaneous

This section contains a variety of miscellaneous information.

Housekeeping material
  • Module name: Scr0380: The forever and repeat until loops in Scratch 2.0
  • File: Scr0380.htm
  • Published: 05/19/13
Disclaimers:

Financial : Although the Connexions site makes it possible for you to download a PDF file for thismodule at no charge, and also makes it possible for you to purchase a pre-printed version of the PDF file, you should beaware that some of the HTML elements in this module may not translate well into PDF.

I also want you to know that, I receive no financial compensation from the Connexions website even if you purchase the PDF version of the module.

In the past, unknown individuals have copied my modules from cnx.org, converted them to Kindle books, and placed them for sale on Amazon.com showing me as the author. Ineither receive compensation for those sales nor do I know who does receive compensation. If you purchase such a book, please beaware that it is a copy of a module that is freely available on cnx.org and that it was made and published withoutmy prior knowledge.

Affiliation : I am a professor of Computer Information Technology at Austin Community College in Austin, TX.

-end-

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Teaching beginners to code. OpenStax CNX. May 27, 2013 Download for free at http://cnx.org/content/col11498/1.20
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Teaching beginners to code' conversation and receive update notifications?

Ask