Games and other programs for the Acorn ELECTRON



Penguin Books


The Penguin Acorn Computer Library is a joint venture, produced by Acornsoft Limited
(in association with Pilot Productions Limited), and published by Penguin Books Limited.

Penguin Books Ltd, Harmondsworth, Middlesex, England
Penguin Books, 40 West 23rd Street, New York, New York 10010, U.S.A.
Penguin Books Australia Ltd, Ringwood, Victoria Australia
Penguin Books Canada Ltd, 2801 John Street, Markham, Ontario, Canada L3R 1B4
Penguin Books (N.Z.) Ltd, 182-190 Wairau Road, Auckland 10, New Zealand

Acornsoft is the software diversion of Acorn Computers Ltd and is based at 4A Market Hill, Cambridge, CB2 3NJ.

This book of program listings, which appear by permission of Beebug Publications, was edited by Lee Calcraft. Beebug Publications publish both Beebug Magazine (dedicated to the BBC Micro) and a new magazine devoted exclusively to the Acorn Electron. Further details and a cassette containing the programs listed here are available from Dept. 102, P.O. Box 50, St Albans, Herts.

Text copyright (c) Beebug Publications Limited, 1983

Special thanks to David Graham, Sheridan Williams and Alan Webster in the preparation of this book.

First published 1983

All rights reserved

Original photography by Nick Wright

Set in Palatino by Dorchester Typesetting Group Ltd

Colour reproduction by Lithospeed, London

We would like to thank Negs for their kind co-operation

Reproduced, printed and bound in Great Britain by
Hazell Watson & Viney Limited,
Member of the BPCC Group,
Aylesbury, Bucks

Except in the United States of America, this book is sold subject to the condition that it shall not, by way of trade or otherwise, be lent, re-sold, hired out, or otherwise circulated without the publisher's prior consent in any form of binding or cover other than that in which it is published and without a similar condition including this condition being imposed on the subsequent purchaser


CONTENTS


Introduction7
ACTION GAMES
Munch-Man12
Robot Attack19
Mars Lander27
Hedgehog30
Invasion39
THOUGHT GAMES
Higher/Lower46
Return of the Diamond50
Five-Dice59
Anagrams68
Life74
VISUAL DISPLAYS
Union Jack92
Ellipto94
Square Dance96
Screenplay98
3-D Rotator100
UTILITIES
Sound Wizard110
Bad Program Rescue113
Bad Program Lister117
Double Height Text119
3-D Lettering121


INTRODUCTION


This book contains a collection of 20 programs for the Acorn Electron, selected by Lee Calcraft. The range of titles is wide, spanning action games such as 'Robot Attack', screen displays such as '3-D Rotator', and utilities like 'Sound Wizard'.

   As you will see, the length of the listings varies considerably too. Some are less than one page in length, while others are six or more pages long. However compactly it is written, a sophisticated game will involve a certain amount of code, and since the object of this book is to provide a collection of good programs, we have included some longer listings.

   We know that the games are good to play -- we have spent a good deal of time playing them; and they have been popular among readers of our magazines. Many of the programs make good use of the Electon's graphics capabilities, and we have tried to convey some idea of screen representation through the accompanying photographs. But a black and white screen shot will rarely do full justice, even with the highest quality printing techniques.

   The programs have been grouped under one of four headings:

   Action Games
   Thought Games
   Visual Displays
   Utilities

Action Games

Action Games will have you glued to the screen. Each in its own way demands a degree of strategy, combined always with good key control and fast reactions. 'Munch-Man' is a new implementation of the arcade game 'Pac Man'. The graphics are good, and it is fund to play. If you want a relatively short program in this category, I would recommend 'Mars Lander'. This plays well, and is challenging even at the lower degrees of difficulty. 'Hedgehog' also deserves a mention. Here you are brought down to earth with a vengeance, as you try to guide a hapless hedgehog across a four-lane dual carriageway and a busy railway track to snatch acorns for supper. In the end, perhaps my favourite is 'Robot Attack' which requires a nice balance of strategy and speed of reaction.

Thought Games

For the restful mood we have included 5 games which are played at a less frenetic pace. The range of games included under this title is again extensive. 'Higher/Lower' invites you to bet on the turn of a card, while in 'Five-Dice', strategy is required to build up combinations of dice sets. In sharp contrast, 'Return of the Diamond' is a small adventure game in which you enter into a dialogue with the computer in order to solve the riddles posed in seeking to return the Great Diamond to Diamond Castle. 'Anagrams' provides an opportunity to test your word recognition; and, lastly, there is the game of 'Life', which has emerged with a whole cult following of its own.

Visual Displays

These are mostly short programs designed to create visually interesting displays, and demonstrate the excellent graphics capability of the Electron. One of the most colourful is 'Union Jack', though you may find 'Square Dance' even more eye-catching. On a different theme, '3-D Rotator' will accept any line drawing and allow you to rotate it about three axes.

Utility Programs

This term may need some explanation. Each of the programs in this group is a utility designed to aid the Electron programmer. 'Sound Wizard', the first, provides a repertoire of envelopes which can be used to test sound effects for subsequent incorporation into your programs. 'Bad Program Rescue' is a routine which magically heals programs which have gone 'bad' in the computer. It may be used in conjunction with 'Bad Program Lister'. The last two programs of the book -- 'Double Height Text' and '3-D Lettering' can be used within your own programs to embellish text displays.

Keying in the Programs

Each of the programs has been listed directly from the computer, and should be bug-free. If one of the programs fails to work when you have keyed it in, it is probably due to a typing error. Here are some helpful hints:

   If you have not typed any programs before, choose one of the shorter ones. 'Square Dance' might be a good one to start with; it is interesting visually, and quite straightforward -- unlike 'Screenplay' or the very long program, 'Life', both of which contain elements of machine code.

   All of the programs in this book have been renumbered in tens so that you can use the AUTO facility to enter them. Type AUTO <return>. The expression <return> means press the key marked RETURN. A number ten will appear on the screen. Now type in the first line of the program, and press RETURN. A number twenty will then appear -- and so on. When you have finished entering the program press the Escape key to stop the AUTO line numbering facility. Note, however, that one or two of the utility programs have a break in numbering to emphasise the central program procedure. Be sure to take account of this.

   All programs should be typed in exactly as they appear. Be particularly careful not to leave out any spaces on program lines. Some of them are vital. Another pitfall for the unwary is the visual similarity between certain letters and numbers. Take care to distinguish between a zero (always crossed in our listings) and a capital 'oh' (0). The number 1, capital I and lower case L are also very similar. To avoid confusion we have not used capital O or lower case L as variable names. You must also watch out for commas and full stops, and colons and semicolons. They may look similar to us at a quick glance, but do not to the computer. If you type a full stop in place of a comma your program will not run.

   When you have typed in a complete program, save it to tape before running it. This may avoid hours of retyping if a disaster occurs. In practice too, it is wise to keep back-up tapes and make copies at various stages during the typing of the longer programs.

   If a program aborts, you should receive an error message telling you what has occurred, and in many cases, the line number at which it occurred. If nothing is printed, try deleting any lines in the program which say ON ERROR, and re-run it. You will now receive an error message unless it is a machine code section which is at fault.

   The error message should lead you directly to the typing mistake. But it will not always do so. If you think that the line given as faulty is in fact correct, then carefully check any data statements (i.e. lines preceded by the word DATA). A missed full stop, comma or a missing item can prove fatal.

   Some program bugs do not give error messages because the program does not actually abort. Then you will need to check your version of the whole program very carefully against the printed listing.

Lee Calcraft