Introduction

The aim of this book is to present a collection of programs that will both be useful in their own right, and illustrate a range of interesting, and in many cases classical, programming problems. The topics cover the entire range of computer applications; from mathematics and graphics, to games, and include a project to develop a compiler for a simple programming language.

Originally the programs were to be presented for one computer, with notes on converting them to run on other machines. However, this soon proved to be impractical due to the wide range of BASIC dialects. Therefore the present format of the book evolved. Each program is presented in two versions; one for the BBC Computer, whose BASIC seems likely to become a standard for the next few years, and the other for the Acorn Atom, its popular predecessor. Readers with other machines should have little trouble converting one of these versions to their particular BASIC.

Finally, I hope that the reader enjoys trying out the programs in the following pages, and is inspired to improve on them, or use them as the basis for more ambitious projects. To this end, many of the programs include a section of 'Further Suggestions'.

Notes on the Programs

All of the programs in this book will run on the Model A BBC Computer, with 16K of RAM, although the programs of Chapter 2 can be modified to take advantage of the higher-resolution graphics available on the Model B.

The versions for the Atom will run on a machine with 1K of graphics memory, with the exception of the programs of Chapter 2, and the Compiler program, which require the full 6K of graphics memory. A floating-point ROM is needed for Rotation, Surface, and Fractions.


Acknowledgements

I would like to thank all the people who helped in the preparation of this book, including Roger Wilson for several useful comments, Tim Dobson and Jonathan Griffiths for assisting in converting the programs to BBC BASIC, and Dorothy Armstrong for proof-reading the manuscript.

For help with particular programs I am indebted to the following: Chris Cant, for the Surface program; Nick Toop, for the programs on which Anagrams, Buzz Phrases, and Patterns are based; and David Deutsch, for suggesting improvements to the Fractions program and for commenting on an earlier draft of the book.

The book was prepared using word processors on Acorn computers, and l would like to thank Acorn for the help provided during this project.

David Johnson-Davies
January 1982