Page 111 - Learn To Program With Scratch
P. 111

The point to take away from this example is that, regardless of the
                          complexity of the problem we are trying to solve, we can always build the
                          solution by gluing together a number of smaller, more manageable pieces.
                          Using this problem-solving technique, we start with short procedures that
                          solve very simple problems and then use them to create more sophisticated
                          procedures.


               Summary

                          In this chapter, we introduced a number of fundamental concepts that
                          will be used extensively in the remainder of this book. First, we explained
                          the concept of message broadcasting for intersprite communication and
                          synchronization. After that, we introduced structured programming and
                          discussed how to use message broadcasting to implement procedures. We
                          then demonstrated the build-your-own-block feature of Scratch 2.0 and
                          explained how to pass arguments to procedures to make the procedures
                          more flexible. We went over several examples that demonstrated dividing
                          a large problem into smaller, more manageable pieces and explained how
                          to use procedures as the basic building blocks for creating large programs.
                          Last, we examined a bottom-up problem-solving technique, in which we
                          put together known solutions to smaller pieces of a problem to solve the
                          big problem.
                             In the next chapter, you’ll learn about the most important concept in
                          any programming language: variables. This introduction to variables will be
                          an essential next step in becoming a proficient programmer.


               Problems


                          1.  Write different procedures to draw each letter of your name. Name each
                             procedure for the letter that it draws. Then write a script that calls these
                             procedures so you can draw your name on the Stage.
                          2.  Create the program shown below, run it, and explain how it works.























                                                                                   Procedures   89

                                           www.it-ebooks.info
   106   107   108   109   110   111   112   113   114   115   116