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
  • DownloadDownload
  • PrintPrint

Introduction

Alice 3 allows you to work with variables. When you have to define complex behaviors for the actors and the scenery, you can declare and change the values for variables with simple statements. This chapter provides many tasks that will allow us to use variables to control values for some parameters.

We will make many birds fly towards a fence. We will make these birds run different races. We will use variables to hold simple numbers but we will also use arrays to hold many instances of diverse kinds of birds. We will run conditional code according to the values of certain variables. In addition, we will use variables to work with parts of a hawk to make it move his wings while it moves. We will write the code to make the hawk fly.


  

You are currently reading a PREVIEW of this book.

                                                                                        

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

  

Start a Free Trial