CHAPTER 2 Examples of ABC Introduction This chapter gives a number of examples of ABC commands and programs. It is through examples that the advantages of ABC become really clear: that ABC programs are concise, clear and understandable. The examples in this chapter have been written for clarity, rather than, for instance, efficiency. This reflects one of the aims of ABC, namely to reduce programming time and let the computer do the work. Shorter, clearer programs are easier to program, easier to get right, and easier to change. The examples often build on previous examples. In particular, the commands and functions from the section on common data-structures are used a lot by later examples. Several versions of some examples are given in order to demonstrate different programming styles, or to show the effect that different choices of data-structures have. Two First Examples To start with we shall give a couple of simple examples. The first, although simple in ABC, would actually ...
Comments
Post a Comment