Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

3. Organizing Statements > Using a counter to run statements many times

Using a counter to run statements many times

In this task, we will learn to group many statements into a block that repeats the execution of the code a specific number of times. We will create a loop that repeats the execution of a group of statements with a synchronous execution the number of times specified by its required integer parameter.

Getting ready

We have to be working on a project with many actors. Therefore, we will use an existing project that has two flowers and a bee.

  1. Open the project saved in the Performing many statements in order recipe in this chapter.
  2. Click on Edit Code, at the lower-right corner of the big scene preview. Alice will show a smaller preview of the scene and will display the Code Editor on a panel located at the right-hand side of the main window.

  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint