Building Blocks for Graphics Experiments
Karl‐Heinz Becker, Michael Dörfler · Cambridge University Press eBooks · 1989
The Fundamental Algorithms In the first eight chapters we have explained to you some interesting problems and formulated a large number of exercises, to stimulate your taste for computer graphics experiments. In the chapters following Chapter 11 we provide solutions to the exercises, sometimes as complete programs or else as fragments. The solution, the complete Pascal program, can be obtained by combining the ready-made component fragments, after which you can perform a great number of graphical experiments. Structured programs are programs in which the founder of the programming language Pascal – the Swiss computer scientist Niklaus Wirth – has always taken a great interest. Such programs are composed only of procedures and functions. The procedures are at most a page long. Naturally such programs are well documented. Any user who reads these programs can understand what they do. The variable names, for example, convey their meaning and are commented at length when necessary. In particular the programs are written in a structured fashion, in which the ‘indentation rules’ and ‘style rules’ for Pascal are strictly adhered to. We hope that you too will write structured programs, and we would like to offer some advice. Perhaps you have read the entire book systematically up to Chapter 11, to get a good survey of the formulation of the problem; perhaps you have also written the first few programs. By analysing our program description you have surely noticed that the structure of our programs is always the same. The reason is that we have always tried to write structured programs.