CASE OF THE PASCAL PUZZLE
THE INFLUX of different versions of Pascal for the Spectrum and QL has certainly made the language more popular with microcomputer enthusiasts and a good book on the subject is essential. Surprisingly enough, one of the best books was written two years ago and creates a novel approach to the language.
Elementary Pascal, by Henry Ledgard and Andrew Singer, may seem an uninspired title for a book but the sub-title, Teach Yourself Pascal by solving the mysteries of Sherlock Holmes, gives some clue as to the tack that the authors follow.
After a brief preface in which an old manuscript containing some forgotten notes, written by that eminent GP Dr Watson, are discovered, the book launches into the first escapade involving Sherlock Holmes. He discovers the Analytical Engine, which we would call a computer, and shows Watson how it can be used by a criminologist to collate facts and render clues more helpful.
Holmes does not see it as a miracle machine which can solve cases but as something that will be useful in proving that his conclusions are correct. "Of most interest to me is that it will provide a way of expressing my logical methods in a rigorous form, and perhaps be useful in communicating to others my modest attempts at formulating a Science of Deduction".
Indeed it does. The explanations given by Holmes, followed by the notes of the authors, combine to produce an excellent, stimulating and amusing text which provides at least a basic grounding in the main Pascal sub-set common to all versions of the language.
The main section of the book is used by Watson to discuss four cases in which Holmes used the Analytical Engine. The first, Murder at the Metropolitan Club, deals with algorithms and shows how ideas for programs can be written down in the systematic way required by the Pascal programming language. Holmes finds the murderer by fitting clues together within a computer environment and then looping around the program instructions until one clue fits with another and the villain is found.
The remaining cases build on the knowledge of Pascal that the first gives. In the Adventure of the Bathing Machine, Holmes enters data about sea tides in order to find the time of a murder and trap a murderer; A Study in Cigar Ash shows how Holmes teaches Watson how to enter data into the Analytical Engine using Pascal and how that information can be accessed; and finally, The Adventure of Clergyman Peter finds Holmes trapping a religious thief with the aid of a train time table and the Analytical Engine.
Once the main body of the Pascal language has been introduced Holmes indulges in a series of three pipe problems. Those are simple cases which show how useful application programs can be written in Pascal. The programs grow more complex but the real authors of the book continue the notes with which they back up all of Holmes' cases. Those notes seem to be for people who have not followed the famous detective's thinking.
Despite its unorthodox approach, Elementary Pascal should help even the most accident prone potential programmer learn the language which is growing more popular all the time. The book's style is somewhat similar to that of Conan Doyle and Holmes is a reasonable counterfeit.