ZXComputing Summer 1982
ZXComputing Summer 1982
ZXComputing Summer 1982
I III I I I M V
The Darnel and the Beast
A game of concentration and ouspence i n which you, the
intrepid hero. must wander i n the darkness and dangers
of the Beafit's palace, find the Da*-.el hiding or imprisoned
there, k i l l the Beast, and then l a s t but not l e a s t , lead
the Daneel t o the palace e x i t before she starves t o death.
An extremely complex, f r u s t r a t i n g and e n t e r t a i n i n g game.
Price £6.50
Dictator
You have .just become the 12?th jrwsident f o r l i f e o f the
state of R i t l a b a . The o b > c t of your rule i r t o do what
a l l previous presidents f a i l e d t o do, that LB, t o take
f u l l advantage o f the s i t u a t i o n f o r your own good.
The program i s supplied on high q u a l i t y cassette, together
with an 3 page booklet containing detailed d e s c r i p t i o n s ,
inrtructionr. arid h i n t s .
iTice £9.00
S t a r Trek
The classio computer game In which you trek acrosr. the
galaxy i n piearch of Klingore to n p with your phasers and
photon torpedoes. You have long and short range scanner* t o
help you f i n d then, litarbases to refuel your s h i p a t and.
of csurse, various witty comment?. froa the crew.
Price £6.50
House of Gnomes
Another f a n t a s t i c adventure game f o r the 16K :x8l.
Price £7.00
INVADERS
Fast moving, machine code version of the famous arcade
game, for the 16K ZXfll. Shields are provided to help protect
you from the boatr of the marching a l i e n s . Ten levelfi of play
from easy to s u i c i d a l . On screen scoring,
i r i c e only £4.00
BUG- BUG-
ZXAS £5.00
SFiriiES PFISNS
Thir. f u l l s p e c i f i c a t i o n ZilO Aascabler acoeabler. a l l the l*rograa hick 1
standard /,il<s/ aneaonicr., which arc s i a p l y written i n t o £3.50
Prograa Ibck Tt £"}. 50
KM* stateaenta within your BAI" IC prograa.rfheD assembled, Prograa i'ack 3 £4.50
the acseably l i s t i n g ; , together with assembled coder, ami trograa Pack 4 £4.50
addrwsix; arc dir.played on the screen. The assembled codec irogram Pack 5 £4.50
and addresses, are die played on the screen. The -Tnr.eab led Ifograa I'ack 6 £4.50
code i c executed by 1FR. The praflraa occupied 5K- 1M®
Irogram luck 7 £5.00
aeart- that /.XX' wiybe used in conjunction with ZXUB.
Program lUck 8 £6,00
The program te a v a i l a b l e for both the l6K ZX81 and the
GK l«*» ZX80. K"ull doctwentation on how t o m e the
anseabler ( i n c l u d i n g a lir.t of the w e w n i o ; ) ir. supplied.
I f I K \ %
ZXDB £ 6 . SO
Multifile
A muitl jxrrpoee f i l i n g systea f o r the 16K ZXfll. A wide range
The perfect complement t o the ZXAIi asr.eibler, ZXDB of possible a p p l i c a t i o n s .
is a complete combined Machine code dlcar-seabler and l"rice £17.50
detwgging program.
Ajurt fro® the the program haj. f e a t u r e , i n c Videof^rnph
including SDIGLE SfKI', BI-OCK SEARCH. TRAK.KrJt AND KILL. Gratliical display and t e s t i n g progrna. Hundreds o f pcr.slble
HKX U)Al)h». RBCI5TH1 DEPUT and • o r e , a l l of which are applications.
executed by simple one key c<H«andr; froa the keyboard.
Frice £7.50
ZXTK rfi.oo
Viewtext
0 ayKte f o r 16K 2 X 8 1 G r t ror
Irfw ^ n T * " " * " ^ <"*pl*y*
ZXTK enhances the f a c i l i t i e s offered by ZX81 BAijIC -
a muit for the serious BASIC p r o p M w r . Includes f u l l
Constellation
re-nuabering, the a b i l i t y to manipulate grcupi o f liner,
and merpe Til«b, road filenaar*. from tapes a**1 "ore. Turn your ZX8l into a telescope. Civets an accurate
representation or the night sky on any date o f the
Century.
RENUM £4.00 Price £0.00
A11 pr leer- Inc lur. lvn.
Hernia lis a f u l l renumbering program. Henuaberc l i n e BUG BYTE
numbers, GOTOh and CtEUft-., and w i l l renuaber existing
pro^njM.. '* t«JP IHt A1HANV
<MDHA11 simi T
In/tWOOl tl«i»
ZX 80/81 HARDWARE/SOFTWARE
ZX KEYBOARD •
Now with repeat key and facilities to add numaric
pad. The keyboard has all the 80/81 functions on
the keys, and will greatly increase your pro-
gramming speed. It is fitted with push type keys as
in larger computers.
The keyboard has been specially designed for the
Sinclair computer and is supplied ready-built. It
also has facilities for 3 extra buttons which could
be used for on/off switch, reset, etc. £27.95.
Numaric add on £10.
4K GRAPHICS ROM
The dK Graphic module is our latest ZX81 accessory. This module, unlike most other
accessories fits neatly inside your computer under the keyboard. The module comes ready
built, fully tested and complete w i t h a 4K graphic ROM. This will give you 448 extra
pre-programmed graphics, your normal graphic set contains 64. This means that you now
have 512 graphics and w i t h there inverse 1024. This n o w turns the 81 into a very powerful
computer, with a graphic set rarely f o u n d on larger more expensive machines. In the ROM
are lower case letters, bombs, bullets, rockets, tanks, a complete set of invaders graphics
and that only accounts for about 50 of them, there are still about 400 left (that may give y o u
an idea as to the scope of the new ROM). However, the m o d u l e does not finish there; it
also has a spare holder on the board which will accept a further 4K of ROM/RAM. This holder is
fitted with a 1K/2K RAM and can be used for user defineable graphics so you can create your own
custom charactor sets. £29.95.
MEMORY 80/81
16K RAM
Massive add-on memory for 80/81. £32.95.
2K & 4K RAM
Static Ram memory expansion for the 80/81. They both work w i t h o n b o a r d Ram i.e. 4K plus
onboard = 5K. This is the cheapest small m e m o r y expansion available anywhere. 2K RAM
£14.95. 4K RAM £19.95.
10 PORT
Interface your computer with the real world, our 10 port has holders to add up to 6K of RAM. £12.95.
16K
As seen at the ZX Microfair.
81 SOFTWARE
DEFLEX This totally new and very addictive game, w h i c h was highly acclaimed at the
Microfair, uses fast m o v i n g graphics to provide a challenge requiring not only quick
reaction, but also clever thinking. One and t w o player versions on same cassette. £3.95
3D/3D LABYRINTH You have all seen 3D Labyrinth games, but this goes one stage beyond;
you must manoeuvre w i t h i n a cubic maze and contend w i t h corridors w h i c h may go
left/right/up'down. Full size 3D graphical representation. £3.95.
CENTIPEDE. This is the first implementation of the popular arcade game on any micro
anywhere. Never mind your invaders, etc., this is positively stunning, the speed at which this runs
makes ZX invaders look like a game of simple snap. £4.95.
Graphic ROM Software Centipede. The graphic ROM version of our popular Centipede game. The
only real version of Space Invaders on the ZX81.
23 Sussex Road, Gorleston,
[K'tronics
Great Yarmouth, Norfolk.
Telephone: Yarmouth {0493} 602453
Dept. Z X C 5 8 2
ZX COMPUTING S U M M E R1)xCOMPUT
ZX Computing Editor: Tim Hartnell Origination and design by M M Design ft Print.
Vo4. One Editorial Assistant: Tina Boylan London
Number One Group Advertising Manager: Ron Moore
Summer 1 9 8 2 Managing Editor: Ron Harris. Published by Argus Specialist Publications Ltd,
Managing Director: T J Conned. 1 4 5 Charing Cross Road. London W C 2 H OEE.
CONTENTS Orbit
A massive 16K Z X 8 1 program to
zap
Get your computer into gear for this little
recreate the orbits of the four inner stunner.
planets of our solar system.
Tourist Trap 38
Here's your chance to get back at all
those people who keep stopping you and
asking you the way to Piccadilly. This
massive ADVENTURE program will run
on a Z X 8 0 o r Z X 8 1 .
ZX C O M P U T I N G S U M M E R1)xCOMPUT
ZX Computing is published quarterly in April, July. October end January. Distributed by: Argus Press Sales b Distribution Ltd. 12 18 Peul Street. London EC2A 4JS
0 1 - 2 4 7 8 2 3 3 . Printed by: Henry Garnett Ltd., Rotherham.
The contents of this publication including all articles, designs, plans, drawings and programs and all copyright and other intellectual property rights therein belong to
Argus Specialist Publications Limited. AH rights conferred by the Law of Copyright and other intellectual property rights and by virtue of international copyright
conventions are specifically reserved to Argus Specialist Publications Limited and any reproduction requries the prior wntten consent of the Company. 1982
Argus Specialist Publications Limited
ZX C O M P U T I N G S U M M E R1)xCOMPUT
iiiiiiniiiMiiiiiiiimiifi
£49*
were sold.
In March 1981, the Sinclair lead
increased dramatically. For just 95
£69.95 the Sinclair ZX81 offers even
more advanced facilities at an even
lower price. Initially, even we were
surprised by the demand - over Higher specification, lower price -
50,000 in the first 3 months! how's it done?
Today, the Sinclair ZX81 is the Quite simply, by design. The ZX80
heart of a computer system. You can reduced the chips in a working
add 16-times more memory with the computer from 40 or so, to 21. The
ZX RAM pack. The ZX Printer offers ZX81 reduces the 21 to 4!
Built:
an unbeatable combination of The secret lies in a totally new
performance and price. And the ZX master chip. Designed by Sinclair
Software library is growing every day. and custom-built in Britain, this
Lower price: higher capability unique chip replaces 18 chips from
With the ZX81, it's still very simple to theZX80!
teach yourself computing, but the New, improved specification
ZX81 packs even greater working • Z80A micro-processor - new
capability than the ZX80. faster version of the famous Z80
It uses the same micro-processor, chip, widely recognised as the best
but incorporates a new, more power- ever made.
ful 8K BASIC ROM - the 'trained • Unique 'one-touch' key word Kit or built - it's up to you!
intelligence' of the computer. This entry: theZX81 eliminates a great You'll be surprised how easy the
chip works in decimals, handles logs deal of tiresome typing. Key words ZX81 kit is to build: just four chips to
and trig, allows you to plot graphs, (RUN, LIST, PRINT, etc.) have their assemble (plus, of course the other
and builds up animated displays. own single-key entry. discrete components) - a few hours'
And the ZX81 incorporates other • Unique syntax-check and report work with a fine-tipped soldering iron.
operation refinements - the facility codes identify programming errors And you may already have a suitable
to load and save named programs immediately. mains adaptor - 600 mA at 9 V DC
on cassette, for example, and to • Full range of mathematical and nominal unregulated (supplied with
drive the new ZX Printer. scientific functions accurate to eight built version).
decimal places. Kit and built versions come com-
• Graph-drawing and animated- plete with all leads to connect to
display facilities. your TV (colour or black and white)
• Multi-dimensional string and and cassette recorder.
numerical arrays.
• Up to 26 FOR/NEXT loops.
• Randomise function - useful for
games as well as serious applications.
• Cassette LOAD and SAVE with
named programs.
• 1K-byte RAM expandable to 16K
bytes with Sinclair RAM pack.
• Able to drive the new Sinclair
printer.
• Advanced 4-chip design: micro-
New BASIC manual processor, ROM, RAM, plus master
Every 2X61 comes with a comprehensive, specially- written
manual - a complete course in BASIC programming, from
chip - unique, custom-built chip
first principles to complex programs replacing 18 ZX80 chips.
M TV',-. ULtl (
n b i xr *
TMtv
LET
IIS?
t^BJ.
LCT
POK
^aes pok
396ft LET
R E r
~ses po*
090 FOR
>991 FOR
99S POK
(>JsK+Z>
1S3 NEX-
OJ (VfffJfT
Name: Mr/Mrs/Miss I I I I 1 I I I I I 1 I I I I I I
ZX8I
6 Kings Parade, Cambridge. Cambs.. CB21SN
Address: I I I
I I I 1 I I I I I I I
L
A l l l l l
o m e
What we're trying to do for
y o u . . . and how you can help us
Welcome to the first bumper articles in this issue to help you development? In this issue of of your computer, whether you
issue of ZX Computing. The fathom out the mystery. Both ZX Computing, we take a trip want it to help you develop your
Z X 8 1 and the Z X 8 0 are great of the articles contain sample through the ZX library, giving programming skills or learn
computers, and we're going to routines for you to enter and you an honest assessment of machine code, play games or
make sure you make the most run, so you can see your some of the books you can buy. use it in business. But we need
of your Sinclair micro. machine code in action im- The same goes for software. you to help us. The only way we
As you'll see by looking mediately. It seems that every cottage in can keep up the high standard
through this magazine, we've If you're tired of trying to the UK hides an industry pro- we've set in this first issue is for
got a host of programs for you make your programs fit into 1K, ducing ZX software. How good you to send us your best pro-
to try, to demonstrate how flex- and don't want to spend too is it? And is it worth the money? grams, routines, construction
ible your micro can be. There much expanding your com- Again our reviewers look fear- projects and discoveries. We'll
are a lot of games, because puter's memory, this issue's lessly at a selection of the soft- pay for any material we use. If
most of us like playing games, construction article will give ware packs on the market. . . you have any opinions on soft-
but there are many other pro- you additional bytes very and reach some surprising con- w a r e or h a r d w a r e y o u ' v e
grams as well to show you, for cheaply and simply. clusions. bought for your Z X 8 1 or Z X 8 0 ,
example, how you can use your The number of Z X 8 1 books At ZX Computing we're or on Sinclair's delivery, repair
ZX computer for business. on the market is bewildering. committed to producing a or back-up service, please
If you don't yet understand How can you decide which is magazine which will be of share them with us, so we can
machine code, but you want to the best book for you at this genuine assistance to you to share them with other readers.
learn about it, we have two stage in your programming ensure you make the most out Tim Hartnell
ZX C O M P U T I N G S U M M E R 1982
Letters
The @*?$1!&£@ 50
60
LET CA - 1 2
INPUT X $
with an assembled Z X 8 1 .
Note that I have no
is relocatable, that is, it can be
placed anywhere in RAM.
RAM pack 70 PRINT V A L X $ connection with Sinclair,
80 PRINT V A L X $ (TO 2) John Miller,
except as a satisfied user.
Dear ZX Computing, Farlington, Portsmouth.
I've read many letters which Entering either C, CA or CAT
D E F Rolfe,
mirror my own problems with produces the appropriate
Sinclair's 16K memory pack. answer on line 7 0 , and will
Haslemere, Surrey. Och aye the 81
I bought a 16K RAM pack, even break down CAT to CA
on line 8 0 to print 12 as the • CAiVUB
PLOSIVE Dear ZX Computing,
and — like so many
answer. Following an advertisement
correspondents — have - ZX81 and a feature in the local
suffered with bytes of
paper, a Z X 8 1 users' club has
information altering Andrew Field,
been formed in tnverclyde
themselves before the Epping, Essex.
(Gourock, Greenock and Port
computer crashed. When 1
Glasgow). The club is meeting
first encountered the problem,
weekly on Wednesdays at
I sent my 16K pack back as I
members' homes in turn.
thought it was faulty. It was
returned with a note to the Our numbers are as yet
effect that there was nothing] small, but they are increasing.
wrong with it. Screen invert We would be grateful if you
could mention us in 'ZX
I have now relieved the Computing', The number to
problem of disappearing data Dear ZX Computing,
When writing games for my phone for meeting details is
but at the expense of my Gourock 3 9 9 6 7 .
Z X 8 0 . 1 made a number of Z X 8 1 , 1 find that I sometimes
'alterations', the first of which need to 'inverse' everything
was to abandon the flimsy top on the screen at a particular
part of the casing. I presumed stage in the program. It is
that the fault was a heat possible to use a BASIC
problem and hoped this would subroutine to do this but this
cure it. It partly worked and so is a slow process — half a
I then unbolted the regulator minute or so — so I set about
and heatsink from the board And an answer writing a machine code
routine which could be used in
and left it standing in free air
with an additional heatsink. Dear ZX Computing, the SLOW mode.
This helped greatly, but did Having read about the various Type in the following
not totally solve the problem. problems with the 1 6K RAM program:
pack, I am beginning to
The final 'modification' was 10 POKE 1 6 3 8 8 . 0
wonder if I am exceptionally
to remove the casing around 12 POKE 1 6 3 8 9 , 1 2 7
lucky, or are all the other
the 16K RAM pack. There are 14 FOR C = 3 2 6 0 0 TO 3 2 6 2 4
satisfied Z X 8 0 / 8 1 users too The club secretary (me) and
1 5 chips inside the case which 16 INPUT N
busy writing long and complex one of our other members
get quite hot. I now have no 18 POKE C, N
programs to find the time to 20 NEXT C attended the ZX Microfair.
problems with data altering —
write? 22 NEW bringing back the saga of a
except under one condition.
When working on a large I did have some crashes day in London neither will
program (3K plus), and with the 3K RAM, so I wrote The numbers to be entered forget. Not that we would
extensively altering the to Sinclair and received a letter (line 16) are as follows: want to. W e only hope it will
program, I find there comes a which included the following; be possible to arrange
point where the computer " W e have found that 4 2 , 1 4 , 6 4 . 6. 2 2 . 1 2 6 . 2 5 4 . something similar further north
lubrication on the contacts 1 1 8 . 3 2 , 8. 5, 1 2 0 , 2 5 4 . 0 , 3 2 , so that all our members can
cannot handle the extreme 5, 2 4 , 6, 1 9 8 , 1 2 8 , 1 1 9 , 3 5 ,
alterations. soives the problems of RAM have the opportunity of seeing
24. 2 3 7 , 2 0 1
pack connections. You should a wide range of both hardware
first clean the edge connector and software.
K Huber, The routine will still remain at
with surgical spirit and then
Hayes End, Middlesex. smear it with Vaseline." the top of RAM, even after
NEW, so it can be used for any Robert Watt,
I did this and had no further Gourock, Renfrewshire.
trouble, and when my 1 6K program LOADed during a
* CXPLCMMVr RAM arrived I repeated the programming session. You
D A M E I
need to include the following *Eric Deeson, the organiser
ZX81 treatment. Again, no trouble of the EZUG (Educational ZX
at all. routine in the BASIC program:
Users Group) is planning a
With regard to Sinclair 9000 PRINT A T 0 , 0 : microfair in Birmingham in
service, I can only say that I 9010 LET R R - U S R 3 2 6 0 0 September. More details on
am very happy. Like many that in the next issue of ZX
others, I received a letter Line 9 0 Q 0 ensures that the Computing. Jo find out more
about the 1 6K R A M delivery. m/c routine starts scanning at about EZUG, send a large,
Mine arrived in four weeks. I the beginning of the screen. SAE to EZUG, Highgate
had a keyboard fault on the The routine takes less than an School, Birmingham B12 9DS.
Z X 8 1 kit that I assembled for eighth of a second to RUN and TH
Catty wonder my son. It was replaced by
return post after phoning
Dear ZX Computing, Cambridge. We had another
The wonders or u.C's little intermittent fault, and as I was
machine never ceases to able to go to Cambridge, I took
amaze me. Did you know that it to the Sinclair office. I was
this program actually works: directed to the Service
Department where, after
10 LETC « 1.5
spending some time on it and
20 LET A - 4.9
30 LET T = 20 failing to find the offending
40 LET C A T - 49 component, they replaced it
ZX C O M P U T I N G S U M M E R 1962
Memotectrs New Memory System for the ZX81
It grows as youprogress
Testing
your
ZX81
speed
Henry Budgett and Tim Hartnell
look at the 'standard' series of
benchmark tests and apply them
to the ZX81 to see how well it
performs. Try the tests yourself
and see if your machine
measures up.
There are a number of ways to establish the efficiency of a com- the information stored, and storing each number as a floating -point
puter, and the tests performed are generally called 'benchmarks'. number uses up much more space than does storing such numbers
Each set of these standard tests tries out a function or functions of as integers. Other BASICs (such as the Acorn Atom and the BBC
the computer, and produces a measureable result which can be Microcomputer, for example) allow you to specify which sort of
compared with other computers performing similar tasks. numbers you wish to deal with, and allots only the necessary space
The most commonly used tests in the microcomputer world are to do so, thus maximising memory and processing speed. The
those introduced way back in 1 9 7 7 by the Yankee magazine Z X 8 0 , of course, works only in integers.
KILOBAUD. While they're not particularly rigorous, they do offer a Anyway, here is the first benchmark:
quick and simple solution to the problem of checking out how well
1 REM *BENCHMRRK DNE*
I the computer performs certain arithmetic functions.
The speed of processing depends on the speed of the micro-
5 I F I N K E Y $<>**'* THEN GOTO 3
u 10 I F I N K E Y T H E N GOTO JO
< processor's clock. In the Z X 8 1 , the BASIC runs at 3 . 2 5 MHz. B<3 FOR K = 1 TO
There are eight benchmarks in the series. Apart from the last 30 NEXT K
o one — which requires the presence of certain mathematical func-
•0 4-0 P R I N T
tions and demands floating-point numbers — you'll be able to run a
version of them on the ZXBO. Each test should be run and timed 1 0
&8 times, then an average of the results obtained. The built-in FOR . . . NEXT function on the Z X 8 1 incorporates a
The first test is a simple loop program that sets up a FOR . . . routine to compare the variable K with 1 0 0 0 , so this program runs
£T relatively quickly. The second test uses the comparison statement
NEXT loop of 1 0 0 0 counts. This, and the other tests, waits until a
© key is pressed after pressing RUN before starting the program. You IF. This runs more slowly, because each time the computer comes
enter RUN, then press NEWLINE, and then touch any key (except across the IF K less than, it has to look up the value of K in its
BREAK) as you start your timing. Lines 5 and 1 0 in each program variable store, and compare this with 1 0 0 0 . This, as you'll see,
ensure that the program waits until la) you've taken your finger off takes time. If you find, by the way, that you do not have the pa-
the RUN key (line 5) and then until you've pressed any key (line tience to wait while your little computer runs through each of these
10). You'll obviously have to omit these lines on the ZXBO. You things a thousand times, change the 1 0 0 0 in tine 5 0 to 1 0 0 . This
stop timing when the zero appears in the top left-hand corner of the is benchmark two:
screen.
The tests are particularly fascinating if you can run them on
1 REM •* B E N C H M A R K TUD*
another computer to compare the times. The Z X 8 1 is not a very
5 I F INKEY$< >"" THEN GOTO 5
fast machine, even in FAST mode. Part of the slowness can be 10 I F I N K E Y $ = " " THEN GOTO J 0
attributed to the fact that the Z X 8 1 stores all numbers as if they 20 LET K=0
were floating point numbers (ie as if they had digits after a decimal 30 LET K = K + 1
point), even when they are integers (whole numbers). The more 50 I F K < 1 0 0 0 THEN GOTO 3 0
bytes a variable occupies, the longer it is going to take to process 6 0 P R I N T "0 '
ZX C O M P U T I N G S U M M E R 1962 11
elements of the array. Specifying memory requirements takes a
certain time, depending on the w a y in which the variables are
stored. Benchmark six:
1 REM JBENCHMfiRK S I X *
5 I F I N K E Y J O " " THEN GOTO S
10 I F I N K E Y $ = " " T H E N GOTO 10
2 0 LET K=0
2 5 D I M H ( 5 )
3 0 LET K =K + 1
4-0 L E T R=K.'2*3+4--5
4-5 G G S U B 7 0 0
4-6 F O R L =1 TO 5
4-3 N E X T L
5 0 I F K < 1 0 0 0 THEN GOTO 3 0
SO P R I N T " 0 "
7 0 0 RETURN
The seventh benchmark fills up this array (tines 4 6 , 4 7 and 4 8 )
every time you run through the loop. If you need to cook a dinner
for 1 0 guests, take the dog for a 2 0 mile walk or repaint the living
room, do it while this test is underway. Benchmark seven:
12 ZX C O M P U T I N G S U M M E RISZXCOI
16K Games
3 1 0 NEXT R
1 REM W l N D i - H _ L By i. L L E X I E 1 X >•"
3 2 0 FR ST
1© FvlINT RT 7 . 3 . U I N D F f L
3 3 0 CLS
L" 3 0 0 0 LET R = 1
20 f-OP. P - 1 TO S&O 3 0 1 0 L ET Y = 1
30 NEXT R 3 0 2 0 LET Ll = - 2 0
n p i N T fV 1 7 , 3 . "THE £ W t E LET Z = CODE B t ( P , 1 )
3 0 3 0
IN5 304.0 LET X =C-ODE P $
5 0 FOP R =2 O 10 -
3 0 5 0 I F V >=U +Z THEN GOTO 3 0 9 0
60 NEX" ' R 30t>0 LET P =CODE R * (R-20+Z.WJ.>
CL5 3 0 7 0 LET C=COOE R $ v R - 2 0 > Z >
80 L ET 3 0 8 0 I F X —P T H E N GOSUB 4-000
9C ET T =3 3 0 9 0 LET R =R + 1
100 LET R - 1 3 1 0 0
LET LET U=U + 1
110
120 LET X" s il C*
3 1 1 0
3 1 2 0
I F
5LOU
R <151 THEN GOTO 3 0 3 0
130 DIM R$ i1S 0 .2) 3 1 3 0
DIM P R I N T RT 1 7 / 6 ; " Y O U COLLECTE
140 B® I 1 5 0 ..23 D
150 LET C = I N T {RND * 1 2 J +1
LET 314-0 FOR R =1 TO 1 0 0
160 P - I N T IRND #17) +3 3 1 5 0 NEXT R
170 P R I N T RT 2 0 , P ; C $ (C.t 3 1 6 0 P R I N T RT 1 9 . . 2.; ' W O U L D Y O U L I
1S0 I F I N K E Y $ = " 1 " THEN L E T X =X -
KE RN OTHER GAME?"
3 1 7 0 P R I N T RT 2 1 , 1 ; '•Y/-N"
' 190 I F I N K E Y $ = "0" THEN LET X + INPUT 5
3 1 8 0
1
200 I F I N K E Y $ = " 9 " THEN LET Z *
3 1 9 0
3 2 0 0
CLS
I F V THEN G O T O 4-0
1
210 PR I N T RT Z ,X;
3 2 1 0 STOP
220 LET R $ ( R .. 1 > = C H R $ P
4-000
4 0 1 0
I F
I F
C = 1 2 THEN LET
C = 14.0 T H E N LET
T=T + 1
T =T +5
230 LET fit ( f l ^ ) - c t i c y 4-020 I F C = 1 3 THEN LET T = T * 0 , 5 5
24.0 LET B $ ( R , 1 ) =CHR$ Z 4-030 I F C = 14-± T H E N LET T = T + 2 . 7 5
2 5 0 LET B $ ( R . . 2J> .x 4 0 4 0 I F C = 1 6 8 THEN LET T = 0
260 LET R =R + 1 4 0 5 0 RETURN
2 7 0 SCROLL
280 I F R <151 T H E N GOTO 1 5 0 L I N E 8 0 1 5 , WITHOUT
2 9 0 P R I N T RT Z , 7 ; " END OF f- THESE 5PRCE5:
it
SHE B s
300 FOR R = 1 TO 1 0 0 W A V
14 ZX C O M P U T I N G S U M M E R 1982 2)
Autumn issue on sale July 23
And we've got even more
for you next time!
= "in-
rseC £
rse£ $
se£ in- Make sure you get the next bumper issue of ZX Computing.
aces.
Features include:
Newsagent,
Please reserve me a copy of the Autumn issue of
ZX Computing, available July 23rd.
Name
Address
n
• 15* VAT WHERE APPLICABLE
perspective1), you've never seen anything like I his before'
OVERSEAS CUSTOMERS ADD
C1.50CARRIAGE PER ORDER GAMES MARKED " incl Machine Code Prices inci VAT ft U K P bP
\W wiinv 1
PAYMENT WITH ORDER PLEASE iadd appropriate postage on Foreign Orders)
TIME DATA LTD . Dapt G , Swallowdala Baiildon.
Euck SS16 5JG Tat. <0268) 411125 (MON-fRI) J.K.GREYE S O F T W A R E
UHIEDALA
D e p t . Z X , 16 P A R K S T R E E T , B A T H , A V O N B A 1 2 T E
Trade enquiries welcome
. a »• •«
« «
<
• •
RECTANGLES a i
INVADERS (IK) AWARI • • •
1 . » WT • a• * •
* •• ftV ft» H
"I had your Invaders React H A M i A A mm
T * OAHT or itt-flft I
rft *>lbC i fi ! ! ' , !
ftft «
ft ft n A»n
cassette . . . I was delighted Mft V
ft
V
with this first cassette."
P. Rubython.
London NW10
#
"I have been intending to write %
16 ZX C O M P U T I N G S U M M E R IS ZX COI
IK Chess?
Graham Charlton shows you how to do pieces are: + Rook; X Bishop; $
Queen; £ King and * Pawn.
the impossible — squeeze a kind of If you have extra memory,
chess into 1K. you can enter an entire game in
This program, which just fits move from E2 to E4, enter one string — M $ — at the
into 1K, allows two players to " E 2 E 4 " , then press NEWLINE, beginning of the program,
96
play chess using the Z X 8 1 as and the board will be reprinted, deleting line 6 0 and adding 1 3 5
their board. The program can with your move shown. You LET M $ « M$ (5 TO). Then the
easily be modified to trigger the need to enter t w o separate computer will whizz through a
printer so you have a perma- strings Isuch as E1G1 and game move by move. It is
nent record of the game. H 1 F 1 ) to castle. fascinating to watch. You may
Pawns are automatically wish to add a loop to slow
It is very easy to use. When
promoted to Queen when things down a bit so you can
the prompt appears, just enter
work out what is going on.
,1
your move as a string, that is. to reaching the final rank. The
I m ^BB^^^^m .
.'.'.'.'.'.'a'A -rib-
i < < < •
TE JLL
• i
•
1 • • • • •
1 1 i A* *
• . <
1
• • « • • •• «• »• t 4
LET
3 7 6 | 6 5 | • m W S4.
3 » 1 J M P 3 2 * * * * * * * 1
• • • • • • • •
X t £ X ? + * * • • • • • m
• • • • • •
2 0 P R I N T R T 0 , O ; • • • • • • t «
3C FOR R « i TO S I STEP 10
4.0 P R I N T R 5 \'R TO • •••n
• > » . . . .. • < V i V i V i V <
5 0 NEXT R
.. •
. . . • • • • • • • • • • • • •
• • • • » . .
• • • i
• • • • •• *
6 0 INPU T MS
• » • <
• • • •
7(3 LET F = 1 0 * (37-CODE MS + CO
• •
•. ••• •
* < • • *
• * • * DE M S - 3 6
• .
. >. •.
.
• • • <
. • • .
• • •
SO LET T = 10 * (37-CODE MS S +CO • • •• • • • • • • »• i
DE MS(3>-36
• • • • •
• * •
• i• * • * •• •• •»• i 9i3 L E T R S ( T ) = R $ <iFS
i * • » • » 4 100 I F T < £ 0 RND fi$(T)=
" THEN • • - * • - * *
Orbit
S M King from Bristol takes
you and your ZX81 far out
into space, where you can
obsereve the four
innermost planets of the
solar system — Mercury,
Venus, good old Earth and
Mars — happily circling the
sun.
S M King from Bristol takes may still find use in an in-
you and your Z X 8 1 far out structive role it would be causes the program to wait until a
Line 2 2 5 :
into space, where you can much better placed in, say, number (the choice) is entered,
observe the four innermost a "Star Trek" type of pro- checks to see if the number entered is a
Line 2 3 0 :
planets of the solar system gram as a "long-range scan- 1, 2 or 3. If it is then the program
— Mercury, Venus, good old ner report". continues at line 2 4 5 . If not, then a
Earth and Mars — happily
circling the sun. The Program reminder is PRtNTed (line 2 3 5 ) and the
program returns to the INPUT
Orbit is a program which The program w a s w r i t t e n statement at 2 2 5 .
was originally intended to on a Sinclair Z X 8 1 with 8K Lines 2 5 0 - 2 6 0 : choose the period incrementing factor
produce an animated simu- F l o a t i n g - p o i n t B A S I C and (in days),
lation of the movement of 16K of RAM, although it by Line 2 6 5 : sets the period counter to one.
the four inner planets in no means uses this much. Lines 3 0 0 - 3 0 5 : display the second "question". How
our solar system around the With the omission of REM many days, months or years are to be
sun. H o w e v e r , it soon s t a t e m e n t s and w i t h the displayed?
became apparent that pro- use of other space-saving
ducing a c c u r a t e elliptical Line 3 1 5 : makes the number entered at line 3 1 0
tips (which will be discussed an integer if it was a decimal. It has no
o r b i t s w a s g o i n g t o be later) the program should
rather d i f f i c u l t , especially effect if the number was already an
fit easily within 7K — with integer. Note that the number must be
w i t h the l i m i t e d 64x44 four planets.
resolution available. The greater than one for the program to
D o c u m e n t a t i o n is given continue.
result is that the program to aid conversion to other
uses circular orbits to Line 3 3 5 : displays the third "question". What real-
m i c r o s and t h e p r o g r a m time time delay is required between
display the relative motion should RUN unaltered on a
of the planets at the ex- successive "frames" of the animation?
Z X 8 0 with the 8K BASIC. Line 3 4 5 prevents the delay from being
pense of accuracy. Whilst it
zero seconds. Line 3 5 0 converts the
figure entered into a number used by
the PAUSE instruction.
Lines 4 1 5 - 4 4 3 : DIMension 8 arrays (2 per planet) to hold
Lines 3 0 - 7 6 : PRINT the introduction. Line 3 5 , for the pixel co-ordinates for PLOTting and
example, PRINTs one blank line, UNPLOTting. The first array in each case
Lines 8 0 & 8 5 : cause the introduction to be displayed holds X-coords, the second Y-coords.
for 4 0 0 0 / 5 0 (80) seconds. The POKE Lines 4 4 5 - 5 2 0 : calculate the positions that each of the
instruction simply resets the system four planets will be at during the
variable. These lines could be replaced simulation. Lines 4 5 0 , 4 7 0 , 4 9 0 and 5 1 0
by a FOR/NEXT loop. calculate X pixel co-ordinates, whilst
CLS is the "Clear Screen" instruction, Lines 4 5 5 , 4 7 5 , 4 9 5 and 5 1 5 calculate Y
Line 9 0 :
assign variables to the number of pixel co-ordinates.
Lines 1 0 0 - 1 1 5 :
radians each planet moves per day. The Lines 5 2 5 - 5 4 0 : "black-in" the starting positions of the
numbers are expressed in scientific planets.
notation: ie, 5 7 • 1 E-03 - 0 • 0 5 7 1 . Line 5 4 5 : sets the main loop counter to one.
Lines 120Ef 125: pixel co-ordinates for the start position Line 5 5 0 : increments the period counter,
of Mercury (Hermes), Lines 5 6 0 - 5 7 5 : display the positions of the planets
Lines 1 3 0 & 135: pixel co-ordinates for the start position during the simulation,
of Venus. Line 5 8 7 : checks to see if the required number of
Lines 140Ef 145: pixel co-ordinates for the start position days/months/years have been
of Earth. displayed. If they have then the
Lines 1 5 0 & 155: pixel co-ordinates for the start position program jumps to line 7 0 0 .
of Mars. Lines 5 9 0 - 6 0 5 : "black-in" the positions of the planets
Lines 1 6 5 - 1 8 0 : assign variables to the "orbital radii" of during the simulation,
each planet. The numbers are the Line 6 1 0 : increments the loop counter,
number of pixels, Line 6 2 0 : returns the loop.
Lines 2 0 0 - 2 2 0 : display the first "question". The
animated display will show successive PROGRAM BETWEEN LINES 7 0 0 AND 9 9 9 ONLY WORKS
earth days, months or years. WHEN THE M A I N SIMULATION HAS FINISHED.
18 ZX C O M P U T I N G S U M M E R 1982 i
ZX81 Programs
Lines 7 0 0 - 7 0 6 : PRINT the fourth "question" down the right SUBROUTINES AT LINES 1 4 9 5 , 1 5 9 5 , 1 6 9 5 and 1 7 9 5 :
hand side of the screen, contain the different pieces of data on each
Line 7 1 0 : waits until a letter(s) are entered. Line 7 1 5 of the four planets.
causes the program to jump to line 7 3 0 if a SUBROUTINE AT LINE 1 9 9 5 :
" Y " is entered. If an " N " is entered then the PRINTs the general headings for the data.
program STOPs, otherwise the program SUBROUTINE AT LINE 2 1 0 0 :
waits at the INPUT statement at line 7 1 0 . converts plot co-ordinates to PRINT AT co-
Lines 7 3 5 - 7 8 0 : display the fifth "question" and wait for a ordinates and then displays each planet's
proper INPUT at line 7 7 5 . initial letter by the pixel square representing it
Lines 7 9 0 - 8 4 0 : execute the various subroutines, on the display.
Line 999: causes the program to halt. Equivalent to an Line 2 1 4 5 contains an inverse " H " .
END statement. Line 21 5 0 contains an inverse " V " .
Line 2 1 5 5 contains an inverse " E " .
SUBROUTINE AT LINE 1 0 0 0 : Line 2 1 6 0 contains an inverse " M " .
"btacks-in" the left % of the screen.
Line 1 0 1 0 contains 2 3 inverse spaces.
Line 1 0 2 5 puts the sun (an inverse asterisk)
in the centre of the black square. The Display
SUBROUTINE AT LINE 1 0 5 0 : (a) PRINT AT co-ordinates: ground an UNPLOT statement
displays the planets in their starting The Z X 8 1 PRINT AT state- DISPLAYS the planet, whilst a
positions. ment is of the form — 9 9 9 9 PLOT statement will "btack-in"
SUBROUTINE AT LINE 1 1 0 0 : PRINT AT (line), (column); the square again. If your com-
displays the period. "{whatever is t o be puter normally writes WHITE
SUBROUTINE AT LINE 1 1 4 5 : •PRINTed)" - where: ON BLACK then it may be found
removes any print statements on the right- line numbers are from 0 to better to make the right hand
hand side by PRINTing blank tines. Nine 21 inclusive. side of your screen WHITE with
>a spaces are contained in the string in tine column numbers are from 0 your inverse spaces. If you do
1155. to 3 1 inclusive. so remember to change all
(b) PLOT/UNPLOT co-ordinates: writing in PRINT statements
ie The Z X 8 1 PLOT/UNPLOT after tine 6 2 0 to your inverse
statements are of the form graphics, delete lines 1 0 0 0 ,
- 9 9 9 9 PLOT (X pixel 1 0 0 5 , 1 0 1 0 and 1 0 1 5 , and
coord), (Y pixel coord) . . . change the characters in lines
"blacks-in" pixel 1025,2145,2150,2155and
9 9 9 9 UNPLOT (X pixel 2 1 6 0 to your "normal" and
coord), (Y pixel coord) . . . NOT inverse characters.
" w h i t e s - o u t " pixel — It may have been noticed
where: that in lines 5 6 0 - 5 7 5 and 5 9 0 -
X coords are from 0 to 6 3 in- 6 0 5 the Y coords are being
clusive deducted from 4 4 (The
Y coords are from 0 to 4 3 in- greatest Y pixel coord). This
clusive causes the planets to revolve
Normally, the Z X 8 1 prints ANTICLOCKWISE about the
BLACK ON WHITE. During the sun. If the " 4 4 - " is omitted
real- simulation, the first 2 3 col- th en t h e p l a n e t s revolve
umns (down all 2 2 lines) are CLOCKWISE. All PRINT AT,
"blacked-in" (Line 1 0 1 0 ) . PLOT/UNPLOT statements are
ing So that the planets and sun referenced to the top LEFT-
can be seen on the bfack back- HAND corner of the screen.
hold
nd
Space Saving
:ase tf the program IS to be used as 4. Put variables AH, AV, AE,
part of some space-borne AM, SXH & SYH, SXV &
he adventure game then its length SYV, SXE & SYE, S X M &
will undoubtedly want to be SYM, RH, RV, RE and RM in-
d 510 shortened. I suggest the follow- to their respective routines.
t ing course of action: (5. Reduce the number of
1. Remove the REM state- planets.)
date Y ments. Again there is no reason why
2. Remove the introduction the planets should be called
he and the first THREE "ques- Mercury, Venus or whatever.
tions". The program was written in a
3. Replace the INPUT state- "modular" form to aid conver-
ments for the three "ques- sion but this does make it rather
tions" by LETs. lengthy.
of
its
RKS
20 ZX C O M P U T I N G S U M M E R IS ZX COI
ZX81 Programs
4.4.5 LET Z=1
4-46
a FOR R =86 TO CS6+ND*S> STEP
45®
5*Z.i ) L E T H t Z ) = £ 2 ^ R H * S I N +
4i 5 5
S*Z) )LET I(Z)-22+RH*COS (&H*
457 LET Z - Z + l
4-60 N E X T R
4 6 3 R E M ** C f i L C U L R T E P O S I T I O N S
OF V E N U S
464 LET Z=1
4-65 F O R R = 2 0 7 T O (20 7+N£>*5> S T E
P 5
4*70 LET U ( Z J = 2 2 +F!V#S IN t2&7
+S *Zi >
4 7 5 L E T U tZ) = 2 2 + R U * C - O S < A U » < 2 * 7
•f S * Z J )
4.77 L E T Z = Z + 1
43© NEXT R
a © 3 R E M ** C R L C U L R T E P O S I T I O N S
OF E A R T H
4 3 4 LET Z=1
•485 F O R R = 1 T O 1 + M D ^ S S T E P S
4 9 0 L E T E (Z) = 2 S f R E * S I M (RE*V1->S
*Z) J
4 95 LET FtZ)=22+RE*COS fRE
*Z> i
497 LET Z = Z U
500 NEXT R
503 R E M ** C R L C U L R T E P O S I T I O N S
MORS
504. L E T Z = 1
5 0 5 FOR R =133 T O i1S3+ND»SJ ST£
P 5
510 LET M (Z? = 2 2 + R M * S I N f R M # f ISC-
>
515 LET N CZJ = 2 2 + R M * C O S <OH*(lS3
)
517 LET Z ~ + 1
520 NEXT R
525 PLOT SXH,5YH
530 P L O T S X U . SY'J
535 PLOT SXE,SYE
54-0 P L O T S X M .. S Y M
54-5 LET U = 1
550 L E T T I M E = T I M E + .1
555 GOSUB 1100
560 U N P L O T H (U ) 1 4 4 - 1 f U > >
565 U N P L O T U ( %J J (44-IJ (UA >
570 U N P L O T E CO) U 4 - F U O >
575 U N P L O T M ( J ) ( 4 4 -N ( J>
530 PRUSE P
535 POKE 16437,255
587 IF U = N D - 1 T H E N G O T O ' 0 0
590 PLOT H(J)j ( 4 4 - 1 J
595 P L O T U CJ) , 1 4 4 - U f u O >
600 P L O T E (J) ..( 4 4 - F (J) .»
605 P L O T M ( U ) ,( 4 4 — N (J)
610 LET U=U + 1
620 GOTO 550
700 PRINT RT S "UOULD YOU"
-
22 ZX C O M P U T I N G S U M M E R 1982 i
16K Games
Bureau de Change
If you're always jetting off
to exotic parts of the world,
like Paris, Geneva or Black-
pool, you'll be in need of
this program which rapidly
converts your money from
one currency to another.
ZX COMPUTING S U M M E R 1982 23
insight
ZX OTHELL*
A major game o f s t r a t e g y
f o r t h e Sinclair ZXS1
p e r s o n a l computer +
16KB R A M
# Easy to learn
For ages 7tol07
/ Pit your wits against
an inhuman intelligence!
Nine levels of play from
novice to expert
. . . is a stylish and
£10
ergonomic plinth for theZX81.lt raises and B E N D F O R O U R E R E E C A T A L O G U E OF"
tilts the TV to avoid eyestrain, holds the16KRAM lOO S E L E C T E D M I C R O C O M P U T E R fiQOKS
in place and hides the wiring and power supply. Prices include P-Pin UK
This very professional unit costs £15, a built-in Add 20", for delivery to Europe. Africa or the Middle East
power switch is £3, plus postage at £1.50, inc. VAT
Peter Furtong Products, 125 Catford Hill, London SE6 4PR. Orders to Moi (223)1 Francis Avenue St Albans Herts
Callers by appointment, please Tel 0 1 6 9 0 7799. Visa, Ac cess. AL36BL England Phone 0727 52801 Telex925859
Z X 8 1 S O F T W A R E F R O M V I D E O S O F T W A R E LTD 1 K & 1 6 K
16K SOFTWARE PRICE NEW VIDEO-INDEX NEW
VIDEO-SKETCH (ZX81 only) Move (he cursor to any Q How do you store 5 7 . 0 0 0 characters in a 1 6K R A M
pan of the screen Draw or rub out as you move n Mix in A Use VIDEO INDEX
text or graphics Save picture in memory Save picture Catalogue your cassettes, your record collection, relerences to
sequence on cassette 7 95 magazine articles Amazingly versatile Capacity for 1 . 0 0 0
VIDEO-PLAN (ZX81 only) Performs the function of an individual references each of which can generate 5 7 characters of
analysis book Arithmetic functions include addition, text Powerful search facilities once the index has been created
subtraction, multiplication 7 95
How is it d o n e ' The system cannot really fit 5 7 , 0 0 0 characters
VIDEO-AD Rotating display of 16 pages of advertising
in a 16K R A M It gives the illusion of doing so by eliminating
material Set-up your own pages and change them as
duplicates For instance in an index of articles in computer
and when required. 7.95
magazines about the Z X 8 1 certain words occur time and again
VIDEO-GRAPH Planning and design aid Create
V I D E O - I N D E X detects these duplications and thereby conserves
pictures/charts/graphs and store within the program. €5 95
space.
VIDEO-VIEW Do it yourself teletext Create pages of
data Store them within the program 5 95 What do you get?
1 A machine code master program which sits at the top of R A M
V I D E O - M A P (ZX81 only). Educational game b3sed on
This is initially loaded like a BASIC program •
maps Navigate your plane to its destination. 5 95
2 A demonstration index containing 1 , 0 0 0 references to articles
FORCE-FIELD IZX81 only) Animated bombardment
about the Z X 8 1 in the popular magazines
game 3.95
3 A detailed instruction manual
SPACE-RACE (ZX81 only) Party game for eight
players 3 95 You may then proceed to create your own catalogues and indexes
and save them on cassette
TEST-MATCH Realistic simulation of a test match
This program is fast, efficient and ingenious and is by far the best
series. Dynamic scoreboard 3 95
product w e have introduced for the Z X 8 1
FOOTBALL LEAGUE Realistic simulation of an entire
N B There isn t room for a commentary on this cassette so you'll
season Every match played and results shown with
have to read the manual
progressive league table 3 95 Z X 8 1 orZX80+"8K R O M
STOCK-MARKET <ZX81 only) An exciting game of skill ZX printer is useful but not essential. Price C9 9 5
and tudgement Buy and sell stocks and shares as prices
change in response to world events 3 95 Mail order customers add f l per order
PACK 1 - V I 0 E 0 - P L A N + V I D E O - A D 17 9 5 Allow 2 8 days for delivery
PACK 2 - V I D E O - V I E W + VIDEO-GRAPH 13 9 5 Cash with order please to V I D E O S O F T W A R E LTD
G A M E S E T - V I D E 0 - M A P + 5 GAMES 19 9 5 Stone Lane. Kinver.
1 K PARTY TRICKS I Z X 8 1 only) 4 95 Stourbridge.
Personal callers welcome during office hours West Midlands DY7 6EQ
26 ZX C O M P U T I N G S U M M E RISZXCOI
A. Beasley
Solutions
To get over the problem the
following method was
developed. First all the
variables are CLE A Red. A
string variable is now set up to
contain the required number of
bytes and the machine code is
POKEd into it. As this string
variable is the first in the list
its location can be found from
the two bytes called VARS,
see page 1 22 in the manual.
By adding one to the value
obtained you have the location
of the first character in the
string. To call the program you
simply find the value of VARS,
add one and use this number
as a USR call.
More Problems
This method generates its own
set of problems, however. If Operation 1 CLEAR
you are using it tor program To use the program type in 2 LET Z$ • *aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
operation you cannot use the with Z$ containing 3 3 3 LET
following commands, RUN, characters. Now run the A$ = ' 0 6 0 0 0 E 0 A 2 1 2 8 4 0 7 0 2 3 7 1 3 E 0 A 8 1 4 F 3 0 -
CLEAR or NEW. By using program then remove it by 0 4 0 4 CB70C0237EFE7620FA237ECB7FC018E6"
GOTO you can get over the typing just the line numbers 4 LET A = 1 + PEEK! 1 6 3 9 2 ) + PEEK! 1 6 3 9 3 * 2 5 6 )
RUN problem and the others and then 'Newline'. The 5 FOR C = 1 TO 3 3
are not really drastic. program you wish to renumber 6 LET B = CODE ( A $ ) - 2 8
The main advantage of this can be keyed in but remember 7 LET B = B* 16
method is that when you save not to use the RUN or CLEAR 8 LET A $ - T L $ ( A $ )
the program you still preserve keys and make sure that the 9 LET B = B + C 0 D E ( A $ ) - 2 8
the string for the next time. It program does not contain Z $. 10 LET A$ = T L $ { A $ }
should be noted that the To activate the renumber 11 POKE A,B
GOTO and GOSUB statements type PRINT USR 12 LET A = A + 1
are not altered but you do get (1 + PEEK(1 6 3 9 2 ) + PEEK- 13 NEXT C
everything into 3 5 bytes. (1 6 3 9 3 ) * 2 5 6 ) .
K
jt-
I*
f>
g
p
f<
tr
ki
P<
library
o
rt
F<
si
o
IT
P'
A
at
b*
a
After the first mad Fi
si
programming spree with fr
st
your machine you may like k)
B<
to build yourself a library irr
m
of useful programs. w
2(
w
V<
se
28 ZX C O M P U T I N G S U M M E R 1962 Z
I
Library
The first few weeks after the
purchase of your Z X 8 1 may
justifiably be defined as the
"infatuation" stage. The
power of the machine to
generate data at apparently
phenomenal speed is
fascinating, even exciting to
those new to the computer
keyboard. Scores of little
programs are lovingly saved
on cassette tapes — most of
them centred around the
FOR/NEXT loop. Typical
programs include printing out
"HELLO" 4 7 times, filling the
screen with nine-digit columns
of sin(x)and —cos(x) or
meaningless equations chosen
primarily for their complexity.
As many of these little morsels
as possible are crammed on
both sides of C 6 0 (or in some
cases even C 1 2 0 ! ) tapes.
Frantic trips to purchase new
supplies of blank cassettes are
frequently made or, if the
shops are shut, a previously
loved recording of
Beethoven's ninth is
irreverently erased in order to
make room for a program
which generates the first
Organisation, The programs, therefore no need
to memorise what you have
is more humiliating to a proud
2 0 0 0 primes (I often wonder Key? named them; if you have to
demonstrator than one of
those sarcastic error
what you do with primes after Any attempt to organise your amend a program, there is no messages which leap up from
you generate them but they computing life must begin danger of the extra few bytes the bowels of the BASIC
seem to offer solace to many). with a simple rule . , . one extending into the obliterating interpreter whenever it suffers
program on a tape with a copy the beginning of the next the slightest confusion.
on the reverse side. program; if the tape is Particularly if you are trying to
Naming Names Superficially, this appears to accidentally dropped into a impress.
But all things come to an end be a shocking waste of tape plate of soup (or a similar 2) Will the program check for
at some time or another. It because, on the average, most household hazard degrades its ridiculous input 7 Remember
sr gradually dawns on most of the tape will remain unused performance) only one that an input can be
people that their "collection" but in spite of this the rule is program is lost; if you lend a mathematically acceptable
is in reality nothing more than sound in human terms. It is tape to a friend for copying and free from syntax error but
a heap of rubbish. Most of better to waste a few feet of purposes and it is returned a can stilt lack realism. For
what they have saved is relatively inexpensive tape in corrupted length of jargon, example, let us assume a
useless, and the few that have return for the following there is less danger of physical program, which assists in the
some merit are buried benefits: no infuriating violence breaking out if only design of a signal amplifier,
between dozens of unwanted searches for programs "in the one program is spoilt. asks for the supply rail
remnants. middle"; no need to name Finally, w e cannot entirely voltage. If the operator
discard a psychological factor. mistakenly keys in 2.6E4
Weeks, perhaps even months instead of 2.6E 4 will the
of programming work stupid machine accept
condensed onto one tape fails this . . . or what is more to the
to impress the casual point . . . will the stupid
10 REM PRIME N U M B E R S acquaintance. Spread out into program accept it and go on to
20 DIM O ( 2 0 O 0 ) twenty or so, neatly labelled
cases with the whole resting
compute a recommended
output current in the order of
30 L E T Z = 1
35 S C R O L L in a partitioned "cabinet" will kiloamps? In short, does the
40 PRINT 2 enhance your local reputation program include full data input
50 LET O(l) =2 as an egghead. validation routines?
6 0 F O R G = 3 T O 2 0 0 0 S T £ P SP 3) Is the program completely
70 FOR H=1 T O Z self-explanatory to the
3 0 IF I N T ( G.-'tf I H J > + /.H* =G T H E N
GOTO 5 0 0
worthwhile operator? Are there, for
100 N E X T H Programs instsice, full instructions on
the V D U screen or does it
150 L E T Z = Z + 1 "Worthwhile" in this sense mean searching for some
200 LET Q ( Z ) = G means "is it worth saving on scrap of paper somewhere
240 S C R O L L tape?" Consider the following which contains the gory
250 PRINT G as a reasonable set of criteria
250 P A U S E 5 0 details of the button-pressing
50© N E X T G from which to start: routines? No accompanying
1) Has the program been document of any kind should
tested for every conceivable be necessary because the
input combination. For VDU screen can tell all. There
example, what happens if you should also be a title page
input a "0" or a negative which defines clearly the
number or a number with purpose of the program.
umpteen digits in it? Nothing Remember that at the time of
Expansion
5) Is the program planned
with the idea of future time, it seems unnecessary. In It means laying out a program difficult; computers are odd
expansion or improvement in fact some of us deliberately in neat little modules, each things.
mind? No program can ever be leave out remarks in order to capable of being individually For example, if someone
perfect and equally true, no prevent other people tested in its own right. In fact came and asked me to write a ^
program can ever be understanding how our there is a specific program to print out a table of
absolutely complete. There masterpiece works. This programming philosophy with the singular solutions of a
will always be the nagging attitude can be self- many little rules and second order differential
doubt, particularly when it is destructive because the writer regulations resting beneath equation I would take the
re-run a few weeks later, that of the program may eventually the blanket title of money in advance and
some extra facility or twist become the victim. Another "STRUCTURED probably deliver the goods
should have been added. In obstacle to future amendment PROGRAMMING". This is (suitably tarted up in
many cases however, this can is a poorly structured original worth detailed study if only to accordance with the previous
be a difficult or even and close-packed line know when to break some of advice) the next day. This is
impossible task. In the first numbers. Never start a the rules. not because maths and
case, the program may be program with line number less physics is my strong point (I
utterly incomprehensible when than 1 0 0 in case some extra Programs To might pass O-level maths with
LISTed if several weeks have stuff may have to be squeezed Write difficulty) but because the
elapsed since it was written. in at the head. Be methodical Advice on what programs to actual maths details must
Juggling with obstinate in the choice of subroutine line write is about as difficult as reside in some text book
statements, temper, numbers. Stick them all advising on the best length for equation somewhere or other.
frustration and the other together well down the a piece of string. An overall It would just be a case of
multitude of ills popular during bottom, say at line 9 , 0 0 0 piece of advice is simply to letting the faithful old BASIC
program construction onwards. In this way, you will walk before you run. Don't interpreter handle the sordid
eventually leads to a transient avoid the ugly embarrassment attempt to write wildly details once the correct
state of euphoria when the of having to leap frog over ambitious programs unless sequence of brackets and
beast finally decides to work. them with a wasted GOTO you are quite certain you operators have been entered
There is a mad rush to "get it statement when the lines start understand the full from the text book to the
on to tape" and indulge in a to creep down further than the implications of the task ahead. VDU.
satisfying bout of self- original estimate allowed. Unfortunately, it takes some Such programs are
congratulation. The term "program experience to know in elementary number crunching
It takes a little while to structure" of course means a advance whether or not a exercises, impressive but
appreciate the value of the lot more than the mere certain programming task is routine. On the other hand, a
REM statement because at the organisation of line numbers. likely to be easy or horribly request for " a little program to
30 ZX C O M P U T I N G S U M M E R 1962 Z
Library
sort and classify my butterfly
collection" could turn out to
be a nightmare. The following
is a crude attempt to group the
classes of programs which can
be written and appropriate EXPLOSIVE
remarks on their respective G A IVIES
difficulty factors.
for «».,. Z X 8 1
Numbercrunching
These follow a relatively
simple pattern; inputting the
required parameters, fitting
them into the "equation line"
and displaying the results in a
clear manner. (liitadhy " *
Two subroutines should be £ Tim Martncll
considered almost
indispensable to number-
crunching activities, one to
round off numerical results to
a desirable number of decimal
places and the other to line up An extra twist is to novel and interspersed with game. The most awkward
the decimal points. Answers incorporate random selection exciting animation takes a thing to get right in
like 3 4 . 5 6 8 9 3 0 2 inches or of the pairs to stop the disproportionate time to programming such a game is
£ 6 7 . 2 4 5 7 8 9 4 5 lack realism operator using a sequence. program in relation to the the difficulty factor. Too hard
and the sight of a VDU screen There is, however, an element subsequent playing time. As and the player is frustrated;
full of figure groups zigzagging of danger in this type of programming exercises they too easy and the game is
from top to bottom is not only program. It tends to breed quiz are superb. Whether many of described as boring.
i! I addicts. Tape after tape is them are really worth the tape
difficult to read, it is quite
revolting in appearance. saved on all possible subjects storage is debatable. Consider
Always use TABln) to position
columns, the semicolon as a
until the entire household
takes on the appearance of a
for example the class of
games which could be covered
Enthusiasm
delimiter encourages Bamber Gascoigne Show. by the classification "Moon The behaviour pattern of the
zigzagging. Landing". They all follow the players, however much care is
same well-worn path . . . you taken with the programming
Quizzes Games are in some dangerous James
Kirk situation . . . too much
details, is distressingly
familiar. Great enthusiasm at
Many sophisticated programs This area is undoubtedly throttle and you run out of first but declining
have been written under the popular and it cannot be something or other . . . too exponentially towards
general title of Computer- denied that senior little and you crack the surface complete apathy. For those
Aided-Teaching or Computer- programmers in the of the moon or Mars or who have a genuine love for
Aided-Learning. Less professional classes devote whatever particular member of game programming the
ambitious but surprisingly many hours to thinking up the galactic regions happens following little tips may be
useful programs are relatively new games or introducing new to fit the title. They will all found useful;
are odd contain a couple of equations
easy to write (and certainly twists to existing ones. Explain the rules concisely
worth saving) based on Unfortunately, a game from the Newtonian tables, in the title page.
jmeone suitably embellished to fit the
questions and answers. program, unless particularly Display as much animation
to write a
a table of
s of a
ntial
;e the
nd
goods
)
> previous
i. This is
Bnd
j point (I
naths with
ise the
. must
book
e or other,
ise of
Id BASIC
ie sordid
rect
ts and
i entered
:o the
re
crunching
/e but
sr hand, a
program to
as your skills in
programming allow.
Don't allow the computer
to respond "too
instantaneously". An
apparent immediate
response does not impress
the player.
Choose your GO-BACK-TO
destinations carefully. It
is pleasant for the ego
when the computer asks
for your name and instantly
promotes you to
" C A P T A I N . . . " b u t it
soon becomes an irritating
chore if this ritual has to be
repeated on each replay.
Take particular care to
make programs crash-
proof. There are some who,
finding themselves in an
irretrievable position, would
crash the program rather
than suffer the humilation
of being beaten by "some
damned machine".
Try and add a few original
twists. For example, allow
a few loop holes for
cheating but make the
computer respond with
something like,
" W e noticed your pathetic
attempt at subterfuge three
lines ago, but in view of your
obvious immaturity, we
decided to overlook the
matter. Should it occur again
you will be disqualified."
Note the use of the royal
" W E " above. . . very useful
little dodge to create an air of
omnipotence, although don't
overdo it by using phrases like
" M v RAMS and I "; subject use examples like milk
bills to start off with. Milk is of
course a delightful source of Tape books have been impressed (and
Dynamic Art health giving energy but the Sales brouchures often draw
educated) by "BASIC AND
THE PERSONAL COMPUTER"
compilation of milk bills is not attention to advantages of by Thomas A. Dwyer and
Providing the world " a r t " is
likely to cause a flutter of storing useful day to day Margot Critchfield but there
not taken too literally, some
excitement, followed by a information on home are probably dozens of equally
quite astonising moving
mad rush to write the computers, recipes etc. as useful. The following little
patterns can be generated on
program. General purpose reference snippets of wisdom (?) may be
most of the home computers.
They are however far more My wife would look at me "books" can certainly be very of some assistance to those
impressive if you are fortunate in sheer astonisment if I useful on tape, providing there who, like myself, have no
enough to own an APPLE or suggested she used my Z X 8 1 is a title selection page or natural abilities in the art of
other model which includes each month. She would pages. Once the tape is loaded programming.
colour combined with high- probably write it out on the (the most annoying stage), it 1) Buy a good book on BASIC
resolution graphics. The back of an envelope in ten is quicker to get at a given and carry out EVERY example
Z X 8 1 , despite the great play seconds flat, certainly before I page by pressing a number of it. It's not a bit of use just
made of its "graphics facility" would have time to fumble key than turning the pages of "reading" a book on this
is not really suited to the job. It round for the ON/OFF switch. a paper book. subject.
certainly has very useful It is appreciated of course that 2) Buy as many magazines on
such simple examples are
graphic "keys" but the
resolution in general is typical weapons of the Programming computing as you can afford
in addition to this one of
pathetic; equivalent to educationalists, based on the It is difficult to say anything course.
painting a portrait with a ten principle "teach from the original on this subject. 3) Keep a notebook, or
inch ceiling brush. know to the unknown", "use Literally hundreds of books preferably a card index
homely analogies" etc etc. have been written on the system, and copy down every
Sorting DATA There is a danger however
of de-glamourising a subject
BASIC language alone,
besides the thousands written
little programming "module" (
or dodge which has general
It is this area that the and underestimating the public on programming principles in purpose use. In this way you
computer is truly at home. mood and intelligence. Why general. However good the gradually acquire a
Every home computing not substitute plutonium manuals supplied are it is background in fundamental
enthusiast should take "data imports for milk bills? The almost essential to dip into the techniques and you can slip
processing" seriously. Strange program would be just as easy pocket again and buy at least them in your programs
how so many writers to write and marginally more one book on BASIC. Which whenever the need arises. Is
attempting to teach this exciting. one? For what it is worth, I this cheating? Depends on I
32 ZX C O M P U T I N G S U M M E RISZXCOI
Library
how you define cheating. even require that supreme academic purists who insist on a good idea to draw out a
There is little point in re- emblem of respectability the a carefully thought out logical rough plan of campaign in the
inventing the wheel on every club tie! approach on paper first. The form of an outline flowchart,
possible occasion. second influence was that of prior to operating the keys.
Issac Newton, not practical necessity. Prior to Another discipline carried
renowned for his modesty, the micro-processor and high over from the past is an
density integration of obsession with memory
once repled to a remark by an
admirer, "If I have seen a tittle
The Final words semiconductor memory, economy. It seems pointless
further than most, it is computing was very to prune a program (that
In conclusion, it is worth expensive, VDUs were non- works) down to the last byte
because I have stood on the examining some advice given
shoulders of giants." To copy existent or rare, every unless there is a real danger of
in the manuals concerning the response was spewed out on running out of memory. If you
down a complete program and art of programming.
pass it off as one of your own reams of expensive paper and, have say, a 1 6K memory and
Apparently, it is a cardinal sin above all, the cost per minute your unpruned program takes
is of course a different matter. to compose at the
Ethics apart (not particularly precluded the luxury of idle 6K why fiddle about with it.
keyboard . . . . it is called doodling. To increase execution speed
fashionable nowadays "winging it". We are
anyway) some one else might The position with the home just for the sake of it is
instructed by the tribe elders computer is different. Very another pointless operation. If
have read the same magazine to write the complete program
and bang goes your few of us can afford printers your program works and it is
on paper before approaching anyway . . . at least not in the reasonably " t i d y " leave it
reputation! The sort of the keyboard; at least every
modules worth saving for first year of ownership. The alone and get on with another.
separate module. This disipline V D U wastes nothing. It is a In this way your tape library
future and continous use came into being because of
include, lining up decimal perfect doodling pad and will grow much quicker and be
two non-related influences. unlike paper, can be used over just as useful as those of your
points, rounding to n Firstly, the influence of the
significant digits, sorting and over again. It is, however. fusspot colleagues.
numbers into ascending or
descending order, sorting
names into alphabetic order,
etc etc.
A word of warning
regarding program modules or
indeed full programs printed in
magazines. Some of them
don't work! The usual cause is
a misprint some where along
the line and readers, to judge
from the rather acidic tone of
their letters, express surprise
that "the Editor doesn't proof
read them before printing".
Proof reading costs time and
but to proof read computer
programs to guarantee 1 0 0 %
error free would probably
treble the cost of a magazine.
In any case, if they don't work
id (and then make them work . . . it's
IC AND good practice anyway and the
)MPUTER" mistake is often the trival
er and omission or incorrect insertion
>ut there of a comma or quote or
s of equally perhaps an unmatched
wing little parenthesis.
i (?) may be Join a local computer club.
to those They tend to be friendly
ave no gatherings all anxious to learn
he art of from each other and refreshing
free from professional
i on BASIC snobbery of any kind. The
ry example home computer addict tends
>f use just to be thought of as slightly
>n this weird by "normal" people, a
kind of mutation. It is
igazines on comforting to spend a few
;an afford hours in the evening with
me of other mutants. The great thing
is to join soon while the hobby
k, or is still young.
idex As the numbers of these
down every clubs grow and the
"module" membership expands to
s general excessive limits, the character
s way you may change, tt could reach a
i state like that which exists in
damental the so-called "exclusive" golf
u can slip clubs, questionnaires on
ams various aspects of the
d arises. Is applicants background.
pends on Perhaps, God forbid, they may
Pe/iAXU4oi , r
o
' — ~\TY"
J ~ \
•
34 ZX C O M P U T I N G S U M M E RISZXCOI
16K Games
Power Boat
sea legs, this little speedy simulation above, the maximum speed
for the section.
should start the adrenalin pumping. faster the boat will go. If
you enter too much power,
and Careth Canister for the PET, and Variables used in this pro-
gram are:
}RTIO
3RT W
zap 1
*zN J L ' R T H E
' I R F O T
REM
(SQ5U5 ® T h N
2 REM
FOLLOWING
COMMANDS:
5K7
EERNDIK?"
GOSUf 7 f ? R N D VB
CHR$
AS
GOSLU?
X"
METRE 3
FUEL
30 ) 7
S
i METRE
FUEL
.00 ) 7
HROUG I
I ED
i
T O U R I S T T R A P is a 4K Z X 8 0 "adventure" type program 140 PRINT "IF YOU GET THERE YOULL NEED)7
which can be easily converted (essentially by changing the way
the random numbers are generated) for the Z X 8 1 . It is very, 150 PRINT " $35 TO BRIBE YOUR WAY IK'
very light-hearted but is fun to play, and gives you a framework 160 PRINT
upon which to construct your own A D V E N T U R E . You might
like to try changing this program slightly so that it asks for, and 170 PRINT ,PRESS NEWLINE"
uses, your name from time to time.
180 INPUT A$
1 RANDOMISE 190 IF NOT A$ = "" THEN STOP
10 PRINT ,"TOURIST TRAP" 200 GOSUB 1610
20 PRINT ,"12 shift G"
30 GOSUB 16 30
50 LET X = 0
60 LET S " 30
70 LET W = 1
80 PRINT "HERE WE GO ON
90 PRINT LONDON TOWN..."
100 PRINT
110 PRINT "YOU HAVE $30, AND YOURE
TRYING"
PRINT "TO GET TO BUCKINGHAM PALACE"
PRINT "(THE PALACE IS ON FOOTPATH 10)
PRINT
ZX80 adventure
1220 IF W < 1 AND RND(IO) > 8 THEN GOTO 17 30 420 IF A = 4 THEN PRINT "TUBE STATION",,
\225 IF W < 1 THEN LET W = 1 "ENTRANCES"
230 PRINT "twospaceTHIS IS FOOTPATH " ;W 4 50 PRINT
250 IF W * 10 THEN GOTO 1690 460 PRINT "WHICH ONE WILL YOU USE?"
,L NEEDm 270 PRINT "SO YOU ARE " ; CHR$(128);CHRg 470 INPUT B
WAY I N"\ (166 - W);CHR$(128);" FROM THE PALACE' 475 IF B > K OR B < 1 THEN GOTO 470
280 PRINT 480 GOSUB 1610
28 5 IF S < 1 THEN LET S = RND(5) 500 IF RND(10) < 4 OR B - A THEN GOSUB
\2 90 PRINT "YOU HAVE $";S;" IN YOUR POCKETS" 1170
300 LET X » X + 1 530 LET C = RND(4)
310 PRINT 540 IF C = 1 THEN PRINT "FOOL";
320 PRINT "five shift S THIS IS PROBLEM ";X
330 PRINT
350 LET K = 1 + RND(5)
360 PRINT
370 PRINT "YOURE FACING ";CHR$(128);CHR$
(156 + K);CHR$(128);"space";
LET A = RND(4)
"CROSSINGS"
Tourist trap
550 IF C = 2 THEN PRINT "IDIOT"; 750 IF A = 1 THEN LET CfS " "PARKING
560 IF C ~ 3 THEN PRINT "HELP"; TICKET"
m
570 IF C = 4 THEN PRINT "SURPRISE"; 810 IF A 2 THEN LET CfS = "PASS TO TB&
620 PRINT "YOURE FACE TO FACE",, TOWER"
"WITH A "; .8
820 IF A = 3 THEN LET C$ - "POSTCARD <S
630 LET A = RND(7) TRAFALGAR SQUARE"
640 IF A = 4 THEN PRINT "GREEN 8 30 IF A * 4 THEN LET Cg - "MAP OF
650 IF A = 5 THEN PRINT "BLUE "; CAMBRIDGE"
66 0 IF A ~ 6 THEN PRINT "BRIGHT RED
670 IF A = 7 THEN PRINT "SICKLY
YELLOW
680 LET A « RND(5)
690 IF A = 1 THEN LET B$ "SMILING
POLICEMAN"
IF A ~ 2 THEN LET B$ - "BEWILDERED^
TOURIST"
IF A = 3 THEN LET B$ TICKET
INSPECTOR"
IF A = 4 THEN LET Bff = "PARKING
WARDEN"
IF A = 5 THEN LET B$ -
"BUS DRIVER"
LET A = RND(7)
-Jm
ZX C O M P U T I N G S U M M E R «
Tourist trap
IKING 840 IF A = 5 THEN LET C$ = "MONKEY ON (9)"tf"POINT THE OTHER WAY(10)?"
A STICK"
1000 INPUT A
>S TO THi 350 IF A - 6 THEN LET C$ = "PACK OF FISH
1005 IF A > 10 OR A < 1 THEN GOTO 1000
AND CHIPS"
1010 LET B - RND(IO)
860 IF A - 7 THEN LET C$ = "RINGSIDE SEAT
>TCARD Ol 1020 GOSUB 1610
AT OXFORD CIRCUS"
1030 IF RND(5) - 1 OR A < 8 THEN LET A = B
900 PRINT B$,"WITH A"
OF 1040 IF A - B THEN PRINT "YOU FOOLED
910 PRINT C$
THE ";B$
920 PRINT 1050 IF A'= B THEN LET S « S + RND(iO)
930 PRINT "HOW DO YOU REACT?" 1060 IF A = B THEN PRINT "AND NOW HAVE
940 PRINT
iS
9 50 PRINT"SPIT(1) ","SWEAR(2) ","SCREAM IF A = B THEN LET W = W + RND(4)
FOR HELP(3)",,"POKE AT IT WITH A IF W > 10 THEN LET W = 10
STICK(4 ) ","SAY YOU DONT SPEAK ENGLISh PRINT
(5)","SAY YOU ARE A STRANGER IN TOWN IF NOT A = B THEN PRINT "THE ";B$;
{• ) nos pace BOOK A " OUTWITTED","YOU"
FLIGHT TO PARIS(7 ) , IF NOT A = B THEN LET S = S • RND(5)
"HAIL A CAD(8)", ,, IF W < 10 THEN PRINT "YOU ARE CLOSE
"BUY A RIOT SHIELD TO",FOOTPATH CHR$(128);CHR${156 +
CHR$(128)
GOTO 160
LET A = RND(4)
GOSUB -1240* (A = 1) - 1 340*(A = 2)
- 138 0*(A = 3) - 1510*(A « 4)
GOTO 160
PRINT ,"YOUVE FALLEN DOWN"
LET B » RND(4)
IF B = 1 THEN PRINT " IN FRONT OF
BIG BEN"
IF B " 2 THEN PRINT " IN THE STRAND'
IF B = 3 THEN PRINT "IN FRONT OF THE
TRAFFIC","IN PICCADILLY CIRCUS"
IF B ~ 4 THEN PRINT RND(99);" STEPS
TO THE THAMES"
LET W — W - 1
LET S = S - RND(2)
RETURN
PRINT "f i vespaceYOU ARE CAUGHT RIDING
ON A","fivespaceNO. ";RND(99);" BUS
WITHOUT A TICKET"
LET W = W - 1 I
LET S = S - RND(2)
RETURN
PRINT ,"YOU GAIN A"
LET D = RND(6)
ZX C O M P U T I N G S U M M E R 19©Z>
Construction
Double
LAD ROM
THE
your R A M
AT
TO
MRS
FROM The limits of the 1K supplied on-board with the standard ZX81
become frustratingly obvious once you start to write programs.
You probably spend more of your time trying to save memory
with little tricks than you do in improving the program. Here's
one solution. Stephen Adams, author of 20 Simple Electronic
Projects for the 2X81' explains how you can double the memory of
your computer. Even if you've never touched a soldering iron
V" before, you should be able to carry out the simple modifications
necessary to get some workable RAM space. This RAM addition
gives not only a full 24 line screen, but also gives twice as much
program space. The 1K extra RAM described in this article is
) $5)
cheaper to install than Sinclair's own suggestion of replacing the
1K chip supplied with a 2K (4816) RAM chip.
The I K of original R A M This chip decodes the upper into, or out of, the RAM chip on 2K sections instead of IKones.
(ORAM) can come in two t w o address lines A 1 4 and the data bus. As the decoding tn other words, it will only
forms, two 2114s or a single A1 5, so that when the correct of A 1 5 / A 1 4 provides only a repeat every 2K within the 16K
4 1 1 8 . The single chip is iden- address for the RAM 16K section in memory, the section.
tified as IC4 in the circuit (1 6 3 8 4 - 3 2 7 6 7 } is on the ad- RAM chip appears again and
diagram and two 2 1 1 4 s as dress lines, the RAM CS line to again, at every I K within that The 7400 IC
lC4a and 4b. Both are con-
nected up to the same data and
the RAM chips is lowered to
binary 0 .
16K section. In order to add
another 1 K of RAM, we have to
Decoder
address tines. They are This line is then used to turn divide this 16K space into The address decoding is done
operated by the same signal, on the RAM chips, so that the larger units or else both chips by a 7 4 0 0 NAND gate IC,
RAM CS, which is generated by other address lines using AO to will appear at the same ad- w h i c h contains four such
the control chip known as the A 9 can detect which byte is re- dress. The line we will use is gates. A NANO gate will only
Sinclair Control Logic or ULA. quired. The data is transferred A 1 0 , which witl provide us with change its output to binary 0
r rot/pj
w 0U T1
•YOU
.ED AS
)U
G A T E S 1 - 4 IN 7400 IC
13
0 VOLTS- PIN 7
+5 V O L T S - P I N 14 CIRCUIT DIAGRAM
when both inputs are binary 1, binary 1. The other input to the third change will be ORAM, as we are going to mount it on tN je
otherwise the output is binary gate depends on A1 0 . It must A 1 0 is now binary 0 again. This Z X 8 1 's PCB using a piece a p
1. Figure 1 shows the connec- be binary 1 to operate gate two, sequence will repeat itself all Blu-tack or a double side< o
tions to the IC. and binary 0 for gate three to the way through the 16K sec- sticky pad, so the legs of the IC
h
The RAM CS line is con- operate. tion. are sticking upwards, and cfe
u
nected to both inputs of gate As A 1 0 changes'every 1K, not make contact with tto
c
one, so that its output of gate starting as binary 0 , then Construction and ZXB1 's PCB. The only connec $
one is constantly binary 0 ,
unless the correct 1 6K section
changing to binary 1, then back
to binary 0 again, the ORAM
Alterations tions that are made are to th»
PCB at the points shown. Th
c
ir
is decoded by the ULA. If the will be first turned on by gate The first step is to wire up the connection to the ORAM C!
RAM CS line is changed to three going to binary 0 , and 7 4 0 0 IC as shown in Fig. 2, lines is made underneath th
binary 0 by the ULA, one of the then the ERAM (Extra RAM), remembering that it is shown PCB.
inputs to gates two and three is The next RAM to come on in the upside down. This is because The RAM CS line appears o
the edge connector pad 2 A, W-
can solder our connection n lr
the 7 4 0 0 IC (pins one and twc C
to the hole connected to th m
A10 edge connector pad 2A. Th g
printed circuit track leadini „
O R A M CS from this pad to pin eight c v
+5 V O L T S lC4b must be cut. Pick a spo £
half-way along the track an t )
make two small cuts about a a
eighth of an inch apart, using f(
craft knife. Then, still using th g
craft knife, scrape away all c
the track in between, sotherei n
no connection between th t )
t w o . Attach the wire from pi e
T O PAD 2A eight of the 7 4 0 0 IC to pin eigf c
O N EDGE of IC4b, whether fitted or n<r
CONNECTOR Keep all the wire to the 7 4 0 0 1 t !
as short as possible withck ((
0 VOLTS
7400 IC (UPSIDE DOWN} touching any other track. A a
E R A M CS tach the 0 volt and +5voltwif b
to either side of capacitor CS s
making sure you get them th t ,
right way round. The only wo t(
44 ZX C O M P U T I N G S U M M E RISZXCOI
Construction
+5 V O L T S 0 VOLTS
CONNECTIONS TO ZX81
IC4
) 7400
T
EDGE CONNECTOR
J
int it on the left is the ERAM CS line. The together. Solder the ERAM CS ween tracks on the PCB and on and the other 2 0 0 nS. This is
a piece of position you fix this will depend wire to one of them, making the tCs. Check that the connec- the time (in nanoseconds)
iuble-sided on what sort of ORAM you sure it does not touch the tions to the PCB are not likely to taken to operate the chip after
gsof the IC have. Stick the 7 4 0 0 IC (legs ORAM'S pin eight. wander about and touch any- the CS line is operated. The
Js, and do upwards) onto the printed cir- thing else. On re-assembling chips needed for this project
with the cuit board in the position the Z X 8 1 and applying 9 volts can be up to 4 5 0 nS. The best
ily connec-
i are to the
shown. The A 1 0 connection
can be made by pushing a wire
One 4118 as ORAM to it, you will find that PRINT
PEEK 1 6 3 8 9 gives a result of
thing is to look at the price of
the chip, not forgetting that you
;hown. The into the hole next to L2 and 7 2 . (f not, or the inverse 'K' will require t w o of them for the
This is a bit more difficult as the
ORAM CS soldering it. does not appear, check all your extra 1K of R A M .
O R A M covers up one of the
»rneath the connections again.
ERAM sockets. An IC socket The 7 4 0 0 also comes in t w o
should be soldered into position The reason for all this work is versions. The original, cheaper
appears on
pad 2A. W e TWO 221S as ORAM onthe IC4b, then a 2 1 1 4 IC
placed in it with its pin eight left
that 2 1 1 4 s only cost 9 9 p plus
V A T , whereas the cheapest
7 4 0 0 and the more expensive
7 4 L S 0 0 . The 7 4 L S has more to
mection to In this case, remove the t w o outside the IC socket. The other 4 8 1 6 is £ 7 . 0 0 plus V A T or recommend its use, however,
ne and two! ORAM ICs and mount t w o 2 1 1 4 must be mounted under- more. If — despite the cost — as it requires less power to
:ted to the more 2 1 1 4 s on top of them. neath the IC4, This is done by you want to install a 4 8 1 6 , operate and has protection
id 2A. Tl ER AM 2 1 1 4 s should have their laying the top of the 2 1 1 4 place it the same w a y round in diodes built into the input of the
ick leading pin eights cut short, so that against the PCB over the pin the socket of the 4 1 1 8 and cut gate. It is therefore best to use,
jin eight of when they are mounted on the connections for IC4a, N o w the strap from L1 to L2. A new as it only costs a few pence
Pick a spot ORAM the two pin eights do not solder wires from the IC4a con- strap must then be inserted bet- more. The 7 4 0 0 and the
j track an< touch. Solder this 'piggy back' nections to the 2 1 1 4 R A M IC, ween L2 and A 1 0 . This modifi- 7 4 L S 0 0 use the same pin
ts about ar arrangement together, except making sure it is the right way cation will not stop you using a numbers.
>art, using i for the pin eights. The top round, so that the cutaway of 16K pack, as the R A M CS con-
till using the ERAM's pin eight should then the IC is nearest the edge con- nection on the edge connector
away all ol be soldered to a piece of wire nector. Do not solder a wire to still works.
n, so there is making sure that it does not pin eight. Join the t w o ERAM's
jtween the touch the lower ORAM'S pin pin eights together using a
ire from pill
;topineighi
eight. These pins are the RAM's
CS pins.
piece of wire and then solder
the ERAM CS to pin eight of the
Shopping list
itted or not ERAM in socket IC4b.
the 7 4 0 0 IC Put the 2 1 1 4 s back into There are at least three dif-
ble without their sockets, making sure the ferent 2 1 1 4 1 K R A M chips
f track. At ICs are the correct way round, available. The L version takes
+ 5 volt wire as shown in Fig. 3. The top and Finishing touches less current and so is useful if
jpacitor C 9 bottom RAMs should be the you are using your machine
let them the same way round. Now join the Before applying any power to with extra boards. The other
he onty wirf two pin eights of the ERAMs the Z X 8 1 , check all the connec- t w o types are differentiated by
together, and solder the ERAMs tions for bridges of solder bet- their speeds. One is 4 5 0 nS
"2A0C40"
"0618"
Machine
code address
LD HL.
(D FILE)
LD B,
Gf
twentyfour
Indeed there are even people
who would go as far as to call it bewildering, but Toni Baker — "23" LOOP: INC HL
IK
author of Mastering Machine Code
"7E" LD A.IHL)
difficult. Suffice to say this is "EE80" XOR80h Sq
46 ZX C O M P U T I N G S U M M E R 1962 ZX C
Machine code
N o w t y p e RUN 9 0 and just see 40 FOR I = 1 T O 5 0 I REM 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 76 PRINT "thirty t w o inverse
w h a t happens w h e n y o u t o u c h 50 NEXT) 901234567890123456 spaces"
any of the keys. Incidentally, 60 RAND USR 1 6 5 1 4 789012345678901234 80 LET X - P E E K 1 6 3 9 6 + 2 5 6 *
lines 1 0 to 8 0 can actually be 70 GOTO 4 0 567890123123456789 PEEK 1 6 3 9 7 + 2 0 0
012345678901234567 90 POKE 1 6 5 1 4 . X - 2 5 6 * INT
deleted altogether n o w , a n d
890123 (X/256)
only line one is needed. F r o m
n o w on, any time the m a c h i n e Run this a n d s t a n d b a c k in N o w R U N t h e p r o g r a m a n d in- 100 POKE 1 6 5 1 5 , I N T ( X / 2 5 6 )
put t h e f o l l o w i n g ( c o u n t i n g " / " 1 1 0 LET A - U S R 1 6 5 1 8
encounters the statement amazement. 120 GOTO 1 1 0
as " n e w l i n e " ) :
RAND USR 16514 the For s o m e t h i n g a little m o r e
machine code magic will w o r k . c o m p l e x , h e r e is a r o u t i n e Lines 1 0 t o 7 6 just print t h e
16516/0101/2A8240/3600/
w h i c h will m o v e a ball a r o u n d a 3 A 8 4 4 0 3 D 2 0 0 2 2 3 2 3 2B 7E b o a r d . Y o u c a n r e p l a c e t h e s e by
Try this little g e m . D e l e t e all
s c r e e n , b o u n c i n g it off w a l l s FE80/200B/2A8240/4A8440 any board-printing routine you
the lines except line o n e . N o w
and bricks. ED44/328440/228240/3A8540 like. Lines 8 0 t o 1 0 0 are ab-
add the following lines:
Y o u c a n d e v e l o p a kind of /3D/2006/11DFFF/19/1804/ s o l u t e l y v i t a l for t h e m a c h i n e
10 FOR l « 1 TO 1 0 0
B R E A K O U T - t y p e g a m e using I I 2100/1 9/7E/FE80/200B code to w o r k , (although the
2 0 PRINT 'three spaces
this r o u t i n e . L o a d t h e m a c h i n e 2A8240/3A8540/ED44/328540 + 2 0 0 c a n be m o r e or less
followed by three inverse /010000/7E/FE08/2009/03/
c o d e loader a t t h e s t a r t of t h e + a n y t h i n g — it just d e t e r m i n e s
spaces'; 3A8540/ED44 328540/228240
3 0 NEXT I article a n d a d d o n e e x t r a line: t h e p o s i t i o n of t h e s t a r t of t h e
/3634/C9/S
ball), a n d all t h e f u n h a p p e n s a t
FE80/200B; 2 A 8 2 4 0 / 3 A 8 4 4 0
1 1 0 and 1 2 0 . T h e instruction
Y o u c a n n o w d e l e t e lines 1 0 on-
LET A a USR 16518 just
wards. m o v e s t h e ball o n e s q u a r e
T o d e m o n s t r a t e h o w this a l o n g . If y o u P R I N T A a f t e r -
w o r k s just add the following w a r d s y o u ' l l find i t ' s a l w a y s
BASIC: z e r o u n l e s s t h e ball hits a brick,
in w h i c h c a s e it will be o n e .
10 PRINT " t h i r t y - t w o inverse
spaces" S o y o u s e e , t h e loop 1 1 0 t o
20 PRINT "Inverse space thirty 1 2 0 is n o w really t h e w h o l e of
spaces inverse space" the ' g a m e ' It's up to you to im-
30 as 2 0 p r o v e it, but as long as y o u
40 PRINT "inverse space thirty
d o n ' t alter t h e m a c h i n e c o d e
graphic A inverse space"
50 as 4 0 a n d just play a r o u n d in B A S I C ,
60 FOR 1 = 1 T O 1 0 r e m e m b e r i n g t h a t LET A « U S R
70 PRINT "inverse space thirty 1 6 5 1 8 m e a n s " m o v e t h e ball
spaces inverse space" o n e s q u a r e " , it should be no
75 NEXT I t r o u b l e at all.
SECOND FOUNDATION
Quality SoPtuare ZXUl SOFTWARE
ie I have bought numerous other items ot software
are excoHent
nsltucnons
They LOAD welt, have perfect
Yours
the most user-friendly > have ever mei "
CQMPUTATUNE T U R N S T H E IK z x e i INTO A
•chin* ONE OCTAVE ORGAN. STORING 100 NOTES PLAYS
1* Imlall^e F t C f "GtlJIT lMVtDHtt- C M M t U
da add re s i | sror mjrss — K COXMJ soon, BACK TUNF AUTOMATICALLY - C 2 75
ZXS1 sort-ware
)HL.
.FILE) STARTER PACK TWELVE IK G A M E S O N ONE
>8, CASSETTE, SEVEN MOVING GRAPHIC GAMES
'•ntyfour GALAXY INVAOERS 'requires minimum 4K RAM) in machine code INCLUDING Road-Race. Subsearch, Tank-Shoot
C HI Cassette and instructions £3 00 A N D Pop. EXCELLENT VALUE - C3 9 0
l A.(HL) 1K GAMES iDuck Shoot. Moonlander, Hangman, Crossword. Letter
)R 80h Square' Cassette arid instructions £3 00 ARCADE PACK FOUR ISK G A M E S ON ONE
>F6h "Just a short note to say how good your Space Invader CASSETTE - Surround. Tank-Shoot Spider Chase
IZ.EXIT cassette is i w<H recommend your company any day " IS A R. Preston)
AND Tenpin Bowling C3.90
) IHL).A "I have iust received your cassette of GALAXY INVADERS
which I thmk is the best on the market ' am very pleased VARIED G A M E PACK FOUR I6K GAMES.
I LOOP with your quick service " (S.C Beds)
INZ LOOP "Enjoying 'GAMES' very much - 'Letter Square' is quite Jaywalker. C a r - C r a s h . Smargana AN0 Fox and
rr addictive " (F W Manchester) Hounds. C A R - C R A S H " IS MACHINE CODE AND
MULTIGRAPHICS 2.3 Requites minimum 16K RAM) cieate drawings, WORTH C3.90 ALONE! ALL FOUR GAMES C3 9 0
you d o not advertising displays, etc. on screen Displays can be saved on tape, printed on
your ZX punter Cassette and 20 page illustrated Manual W 50 T O L I N K A - isK U S E Y O U R z x a i A S A C H E S S
what I've
IK GRAPHICS Kaleidoscope. Large Print. Medium Print, Draw a Picture! GAME RECORDER FEATURES TOO NUMEROUS
t-hand c o l
Manuarf only 'contair accurate istmgs, notes, information and ideasl C3 00 TO M E N T I O N C3.90
do is e n t e r Cassette and instructions £3 00
ie left c o l - Package of cassette and manual £4.50 G.C.E. E X A M S 180 MIN EXAM IN O LEVEL
done t h a t IK STATISTICS >4 programs descriptive and inferential stats) Cassette and PHYSICS OR MATHS - GIVES GRADE AND
j program. instructions C3 00 DETAILED REVISION PROGRAMME C3.90 EACH
"I acknowledge receipt of MULTIGRAPHICS and
STATISTICS Having experienced nothing but trouble with
s software, i was agreeably surprised by the good
quality and flexibility of your products IV S Berks I
2X80 S O F T W A R E A L S O A V A I L A B L E Prices are inclusive (Overseas add £1 0 0 P&PI
* Send s a e tor details, describing your system Send s a e for details, or cheque with order to
B R I D G E S O F T W A R E I Z ) ' M a i l order o n t y W S E C O N D F O U N D A T I O N . 22 Bramber
Eu,0 Belgrave, Tamworth Staffs B77 2LL
36 F E R N W O O D , M A R P L E B R I D G E , °~n
STOCKPORT, C H E S H I R E SK6 5BE Work*™* top rem
L
are found near the ends of the tape.
PROGRAMS AVAILABLE
HILDERBAY LTD ZX SPACE INVADERS. lYou've tried the rest, now
8/10 PARKWAY, REGENTS PARK try the BEST.
LONDON NW17AA This program has many features including an ever
increasing rate of play, (they'll get you in the end).
only £3.95
Enquiries for Hilderbay Ltd. will now be handled
by HOLDCO LTD. Tel. 01-251 3090 ZX BREAKOUT. Quite simply the best breakout on
the market.
Features seven bat angles, (you won't find this one
A L S O O N ZX81 + 16K easy).
o n l y £3.95
Financial Budget/ C a s h Flow Forecast: T h e program
ZX NEW YORK. |A very addictive arcade game.
allows thirteen c o l u m n s (12 m o n t h s + total). T h e forecast
c a n be c h a n g e d a n d a " W H A T IF?" possibility c a n be ex-
Bomb and shoot your way out of trouble, otherwise
a m i n e d on t h e screen. £25. you are doomed to crash.
Generates a different pattern, for a different
Sales Day Book: k e e p s a record of all invoices, with nett,
game each time you play. On the reverse of the
VAT, zero rated a n d total. £18.
cassette is ZX REFLEX, find out how fast you really
Purchase Day Book: k e e p s records of alt p u r c h a s e s a n d are.
VAT. £18.
^ ^ ^ ^ ^ ^ ^ n o w o n l y £3.95
Petty C a s h Book: K e e p s a record of all petty c a s h ex-
S a E H ^ T h e original and still the best
p e n s e s a n d a l l o w s for VAT to be c a l c u l a t e d from total if
Graphic display of Chessboard 6 levels of play
unknown. £18.
Displays record of your moves and the computers.
C a s h Sales Day Book: a s s a l e s day book but w i t h t h e addi- Board can be set up to any position. Has ability to
tional " M e t h o d of p a y m e n t " feature, incl. c a s h , c h e q u e , change sides or level in mid-game. PLUS
postal order, Access, Barclays, sundries a n d unpaid. £18. CHESS CLOCK on reverse side, records time taken
Cassette Recorders: individually tested f o r Z X 8 1 a n d sup- by each player. Resetable function. Single key
plied with a test t a p e for loading. £22. entry.
Barcharts for Architects: a simplified version, t a k e s a w a y NOW ONLY £6.50
the tedious task of m a n u a l l y h a n d l i n g the p r o b l e m £25. All our games are written in machine code, and can be used with
Bank A c c o u n t : c a l c u l a t e your b a n k c h a r g e s whilst keep- joysticks or keyboard, (except chess, keyboard only) Supplied on |
ing your account £5. cassette with library case
To allow vou to prove to yourself that our products are second to |
Architects P r o g r a m s : Barchart w i t h S-curve/Dewpoint none, MICRO GEN offers the following terms to our customers
c a l c u l a t i o n s N.B.S. on c o m p u t e r / S t r u c t u r a l programs/etc. 14 D A Y S FREE APPROVAL
etc. ON ALL PRODUCTS
All programs now alsoavailable for ATARI and S H A R P E All money will be refunded if goods are returned in good i _
condition within fourteen days of despatch. | J
HOLDCO LTD.
14. BRITTON STREET Postal O r d e r s p a y a b l e to: 2 P
1
LONDON EC1M5NQ M I C R O GEN Dept Z X C
1
24 A g a r C r e s c e n t , B r a c k n e l l , B e r k s .
Tel: 01-251 3090 T E L : (0344 ) 27317
1
ZX COMPUTING S U M M E R 1 ) x CO
Micro
This program it fascinating to end, the number of moves it took Y = 1 T H E N GOTO 120
watch, and makes a good demon- is shown. Y=6 THEN GOTO 169
stration of the ZX81, A 'mouse' Y-3 THEN GOTO 200
fan inverse asterisk) starts off in The obstacles change position,
a random position somewhere near the mouse flashes off and on a Y=4- T H E N G O T O 2 5 0
the top left hand corner of the few times, and then begins again. Y=5 THEN GOTO 290
9creen. It is aiming for the bottom The mouse cannot get itself into a Y =2 T H E N P P T D J
right hand corner. There is a solid trap it cannot get out of, unless Y=7 THEN GOTO 330
black 'frame' on the screen, and a it happens to land in one at the INT RT R+l,Bj
number of obstacles are placed very beginning, so have patience, PEEK ( P E E K G + 2 5 6 * P E E K H>
randomly within the frame. When no matter how long it seems to =0 T H E N LET T - 1
the mouse finally makes it to the be taking. 14-0 I F T = 1 T H E N L E T R = R * 1
150 IF T = 1 T H E N G O T O 1 0 0 0
152 IF R N D > * 2 T H E N G O T O 1 6 9
154. IF R = 0 O R B = 3 0 T H E N G O T O 1 6
1 REM M I C R O M O U 5 E 1BK 9
5 LET G = 16398 155 P R I N T RT R-1,B#1;
6 LET H=G + 1 1 5 6 IF P E E K CPEEK G + 2 5 6 # P E E K H)
10 PRINT RT 0 . 0 =0 T H E N L E T T =1
1 5 7 IF T = 1 T H E N L E T B =B
1 5 8 IF T = 1 T H E N L E T R = R - 1
1 5 9 IF T = 1 T H E N G O T O 1 0 0 0
F O R R =1 T O 2 0 1 6 5 IF R N D < . 2 T H E N G O T O 1 1 0
II
35
«•
P RINT RT 2 +RND#18, 1 +RND#27; 1 6 9 P R I N T R T R ^ B + 1.:
1 7 0 IF P E E K (PEEK G+256*PEE.K
ii
3 6i i P R I N T RT 2 + R N D * 1 8 _ . 1 + R N D #27,; =0 T H E N LET T = 1
1 8 0 IF T = 1 T H E N L E T B = B * 1
l*
3 7I* P R I N T RT 2 + R N D f 18..1 + R N D #27.; 1 9 0 IF T = 1 T H E N G O T O 1 0 0 0
1 9 5 IF R N D < . 6 T H E N G O T O 2 9 0
4-2 P R I N T RT
*•
R/0;"M" 200 PRINT RT R+l.B+l:
4-3 P R I N T RT 3 + R N D H 5 , 2 +RND#22; 2 1 0 IF P E E K ( P E E K G f 2 5 6 * P E E K H.»
-» »• =0 THEN LET T =1
4.4. P R I N T RT 2 + R N D H B , 1 #RNP.#27; 2 2 0 IF T = 1 T H E N L E T R = R # 1
tl it
2 3 0 I F T = 1 T H E N L E T B = B +1
4-5 P R I N T RT 2 + R N D # 18 2 # R N D * 2 4 ; 24.0 IF T = 1 T H E N G O T O 1000
24.5 IF RND <.3 THEN GOTO J10
4.6 P R I N T RT 3 4 R N D * 1 5 , 2 +RND #27; 250 PRINT RT R-l^B;
2 6 0 IF P E E K (PEEK G + 2 5 6 # P E E K H)
47 P R I N T R T 2 + R N D H 8 , 2 + R N D #24- J = 0 T H E N L E T T = 1
IS
MQ t
2 7 0 I F T = 1 R N D R > 0 T H E N 1JFT ,R=*P
P R I N T R T R . 3 1 ; "•'*
57 P R I N T R T 2 + R N D * 16.. 2 -f R N D #26.; 2 8 0 IF T = 1 T H E N G O T O 1000
290 P R I N T RT R,B-1;
60 NEXT R 3 0 0 IF P E E K ( P E E K G # 2 5 6 # P E E K Hi
61 FOR Z=1 T O 13 =0 T H E N L E T T = 1
62 P R I N T RT 2 0 . 3 0 ; " " 3 1 0 I F T = 1 R N D B >0 T H E N L E T B = B
63 PRINT RT 20,30; ' B "
64- P R I N T RT 2 0 . 3 0 : "fS" 3 2 0 IF T ~ 1 T H E N G O T O 1000
65 PRINT RT 2 0 . 3 0 ; " " 330 IF B =0 OR R =0 T H E N G O T O 1 1 0
66 PRINT RT 2 0 , 3 0 ; " D " 34.0 P R I N T R T R - l ^ B - 1 ;
67 PRINT RT 2 0 . 3 0 ; " " 3 5 0 IF P E E K ( P E E K G 4-256 # P E E K -H.»
68 NEXT Z =0 T H E N L E T T = 1
70 L E T R = I N T ( R N D * 6 + 1) 3 6 0 IF T = 1 T H E N L E T R = R - 1
75 LET Q=0 3 7 0 IF T = 1 T H E N L E T B = B - 1
80 LET B = INT (RND*15fl) 3 8 0 I F T = 1 T H E N G O T O 100P»
85 PRINT RT 2 0 . 3 0 ; " " 390 GOTO 110
90 LET E=R 1000 PRINT RT E . F ; " "
95 LET Q=Q+1 1010 PRINT RT R , B ; " B "
100 LET F=B 1020 G O T O 90
101 IF R = 2 0 R N D B = 3 0 T H E N G O T O 2000 P R I N T R T 0.. 1 5 O ; *Ji"
2000 2010 FOR N =1 TO 50
105 LET T=0 2020 NEXT N
106 IF R N D > . 24-78 T H E N G O T O 1 2 0 2 0 3 0 P R I N T R T 0 , 1 5 ; " |
110 L E T Y = I N T ( R N D # 7 ) +1 204.0 G O T O 3 0
POKElng
50 ZX C O M P U T I N G S U M M E R 1 ) x COM
POKElng
have a display-file we can now to the listing extend this
• • • • • • • • • • • • • i • • • • • • • • • •• •• • • • • •• •• •• • •
take a PEEK at its starting simple program:-
9
address. The following Specify character to be ' • • • • • • • • • • • • • • • • • • a
l l t i p
subroutine achieves this and it POKEd:- • • • • • • • • • • • • • • • • • • •
is used in all subsequent • • • • • • • • • • • • • • • • • • • •
•
• .• • .• • .• • .• • .• • .• • . a • • • •
• • • • • • • • • • • • • •• •• •• ••
listings:- 8 4 INPUT C • • • • • •
i • • • •
Of course the display-file 1 1 0 POKE W + Y,C •v.v.v.
has to exist before we can (C is relevant character code) - v . v . v . ,
start PEEKing and POKEing at
it. If we wish toi POKE onto a POKE character taken from
blank screen then it is first the keyboard:-
necessary to create a display-
file full of spaces. 84 INPUT C$
Unfortunately a succession of
I
86 LET X = CODE (C$)
PRINT statements will not 88 IF X > 1 9 1
achieve this and although a THEN GOTO 8 4
FOR . . NEXT loop PRINTing 1 1 0 POKE W + Y,X
S individual spaces will, it is very
cumbersome. Luckily
PRINT . . . creates a line full of it will be noticed that the
e spaces so a short loop can be
used to produce the required
programs above assign
variables P and W before the
number of screen lines. first PEEK. This is because, as
E Obviously characters can be
used as well as spaces to
mentioned before, any
variable assignment or initial
create a display-file. Up to 2 3 input will alter the location of
lines can be printed in this the display file. If you write
way. any screen-POKE programs
Having ensured that we and find that the characters
have a display-file we can now are displaced it will almost
take a PEEK at its starting certainly be because a variable
address. The following in either PEEK or POKE has not
subroutine achieves this and it been previously assigned. A
k is used in all subsequent similar case is where an initial
listings:- input or an assignment is 2 3
made after a previous PEEK or 4 5 6 7
8 9 o
5 0 0 LET P = PEEK{ 1 6 3 9 7 ) POKE, when it will be 0 "Z * -
v -
5 1 0 I F P > 127 necessary to take another
r v u
THEN LET P = P — 2 5 6
PEEK at W before POKEing «*o mam •
• o ' p'
again.
520 LET W = PEEK! 1 6 3 9 6 ) A
~ 0 ° f ** 0 B »
+ P* 2 5 6 «H J K L 37
careful POKES
cu ..cute mi
530 RETURN
* X C
V fl >
Another thing worth W M
It should now be obvious how
we can use this address to remembering is that POKEing
POKE a character onto the can be a hazardous occupation •
•
•
•
•
• • • t * « *
• • • • • •
U M M E R 1983 z x
COMPUTING S U M M E R 1982 51
POKEing
eaten a penalty of 5 moves is 3 2 and displays the total at 38 LET Z = Z + 1 Count No. of moves Th<
incurred. Numerals 6, 7 or 8 the end of each game together 40 INPUT C Which way? adc
are input as pseudo-cursor with the best performance in 42 GOSUB 5 0 0 Locate display-file CH
controls to move the insect the present series. Pressing 44 LET M = W + (A — 1 >" 3 3 + dis|
down, up, or forwards NEWLINE after a game sets up B the
respectively. The computer another game in the same 46 POKE M, 0 Put a space where insect ; i n c
keeps track of the number of series. Entering a character 48 I F C = 6 and A > 11 Set A and the
moves taken to reach column starts a new series. O R C = 7 AND A > 1 THEN make sure we don't at t
LET A = A — 2 * C + 13 POKE off-screen can
50 I F C = 8 THEN LET B = 8 + 1 line
2 LET Y = 3 2 0 0 0 No. of moves — best so 52 LET M = W + (A - 1 C 3 3 + Set M to next insect Mev
far! B location address jse
4 INPUT R Seed for random number 54 IF PEEK(M) = 1 2 8 THEN LET If there's a black square \7~fe
generator Z = Z + 5 the way, add penalty J)te
8 LET P = 0 56 POKE M, 2 0 Put insect in next locatior -j
10 LET W = 0 Assign variables prior to 58 IF B = 3 2 THEN GOTO 6 2 Watch for end of game j l s
PEEK 60 GOTO 3 8 Next move
12 LET B = 1 and POKE 62 IF Z > Y THEN Y = Z Set Y to best so far ^
14 LET A = 8 64 PRINT "END OF GAME IN he
16 LET Z = - 1 " Z , " MOVES" x>si
18 LET M = 0 66 PRINT "BEST SO FAR", " Y , " >OK
20 RANDOMISE R Set seed for random MOVES" her
number generator 68 INPUT X$ i th<
22 FOR N = 1 TO 3 5 2 70 CLS
24 LET D « 9 72 NEWLINE for another J?®',
26 LET X = RNDI2) IF X$ = " "THEN GOTO 8 game
28 IF X = 1 THEN LET D = 1 2 8 Print eleven lines with 74 Any character for anotha^ OL
30 PRINT CHR$(D); black and grey squares at RUN series )3rc
random. Pattern 5 0 0 LET P = PEEK(1 6 3 9 7 ) hrec
determined by R. 5 1 0 P > 1 2 7 THEN LET P = P - 2 5 6 Subroutine for setting W j
3 2 NEXT N 5 2 0 LET W = PEEK(16396) to address of start of rt
3 4 GOSUB 5 0 0 Locate display-file 4 P* 2 5 6 display-file
3 6 POKE W + 2 3 2 , 2 0 Insect in initial position 5 3 0 RETURN . T
AND FOR
s
P
(f
P
. T
|ai
THE '81
C
P<
H
<2
cc
ac
CI
ef
e\<
ug
While there are many
similarities between the
ZX80 and the ZX81
in the way the display
is handled, there are some
significant differences.
52 ZX C O M P U T I N G S U M M E RISZXCOI
POKEing
sves The display file is a block of
addresses that contain the
ile CHR$ codes that form the
display on the TV screen. At
the beginning of the file we
sre insect is find a Newline CHR$, and
there are also Newline CHR$
ion*t at the end of each line. As we
n can print up to 32 CHR$ per
line, every 33rd CHR$ = a
lsect Newline CHRS. These are
s used by the ZX81 ROM as
k square in references and should not be
snalty altered.
xt location To find the position of the
jf game display file we can use: 5 LET
Z= 1 + PEEK 1 6 3 9 6 + 2 5 6 *
j far PEEK 16397. " Z " will now be
the address of the first print
position on the screen. If we
POKE Z with any CHR$ code
then this CHR$ will be printed
n the first position on the
position, and so on, as shown
nother on the chart.
To prevent printing, or
for another should I say POKEing, to the
33rd CHR$ there are generally
three different approaches.
setting W 1. To use a dedicated POKE
tart of routine that can never work
out to hit a 33rd CHR$. ZX8t
2. To peek at the position on the
screen before POKEing, ie if
PEEK (position) = 118
(Newline CHR$) then don't
POKE here.
3. To use a formula that will
automatically skip every 33rd
CHR$, ie let us say X is the
position we wish to poke then
we can use POKE
(Z + X + INT(X/32),(CHR$
code) this will automatically - D H O l V f
add one after every 32nd - PROGRAMMING
CHR$ making 3 3 = 34
effectively, and so on for
every line. A simple program
using this formula :-
5 LET Z = 1 + PEEK 1 6 3 9 6
+ 256*PEEK 1 6 3 9 7
10 FOR X = ' T O 7 6 3 STEP 7
2 0 POKE (Z + X + INT(X/32)),8
3 0 NEXT X
4 0 STOP
(Note:- That this formula
automatically adds one to
every 33rd position. The One thing to remember is that have hit the target. 1.5 positions per line to hit the
memory map chart must be the display file is using the Looking at this idea w e can top right-hand corner.
read as (position) — (line memory immediately after the see that system 1 can be used Considering we have 9 shifted
number on left) to give the BASIC program. This means as we don't intend to POKE to the right options (0 to 9) if
correct number per position). that if the BASIC program is over the edges of the screen, we use 1.5 + 9 = 0 . 1 6 6 *
ANOTHER SHORT PROGRAM altered then " r u n " is required and the plotting involved has a (the INKEY$ number) this will
5 LET Z = 1 + PEEK 1 6 3 9 6 to find the new value for " Z " , limited path. give us the right amount of
+ 256*PEEK 1 6 3 9 7 or at least the new value for After the normal line 5 to shift per line to plot our gun
10 LET A = 0 " Z " must be calculated. find " 2 " w e then POKE fire. I've rounded down to
20 LET B = 3 3 An idea of a simple program Z + 7 2 6 , 1 2 8 to put a square 0 . 1 6 so there is no chance of
25 IF A < 0 OR A > 7 6 7 may be as follows. W e have a block for the gun. Then to fire over-stepping the corner if 9 is
THEN GOTO 3 5 gun at the bottom left-hand straight up to the top line is selected. So the basic program
30 POKE Z + A + INT/A/32), side of the screen. Pressing easy, we simply POKE is shown as, an INKEYS input,
128 any key from 0 to 9 will fire Z + 6 9 3 , 2 3 then successively followed by the fire routine.
35 LET A = A + B the gun at a target at the to - 3 3 from this, poking all the
4 0 IF A > 0 THEN LET B - 3 3 line on the screen, " 0 " to fire way up to 0 . Taking the top
50 fF A > 7 6 7 straight up, " 9 " to fire line to equal 3 2 CHR$ wide (Note: - The line numbering
THEN LET B = - 3 1 farthest right, w e will also and the number of lines down should be followed to leave
6 0 IF A = 27 THEN C I S need to PEEK at the top line in to the gun being 2 2 we must room for the rest of the
- 7 0 GOTO 25 the relevant place to see if we shift to the right 32 + 22 = program).
z
U M M E R 1983 x COMPUTING S U M M E R 1982 53
POKElng
BASIC PROGRAM Beginning to run out of
ideas now, I decided to use
5 LET Z = 1 + PEEK 1 6 3 9 6 the above with different CHR$
+ 2 5 6 * PEEK 1 6 3 9 7 making line 2 0 0 POKE
1 0 0 POKE Z + 7 2 6 , 1 2 8 Z + B , 2 4 . You will see the
1 5 0 LET AS = INKEY$ difference is astounding.
1 6 0 IF A $ < " 0 " OR A $ > Finally, learning the effect of
" 9 " THEN GOTO 1 0 different CHR$, I settled for
1 7 0 LET A = VAL A$ the flake drift effect using
1 8 0 FOR B = 6 9 3 T O O STEP CHR$ 2. Because this is only a
- 33 quarter size it gives the
2 0 0 POKE Z + B,23 impression it's moving twice
2 1 0 LET B = B + A * 0 . 1 6 as fast (very useful). The
2 2 0 NEXT B correct final program then is:-
3 2 0 GOTO 1 1 0
190 POKE ( < 6 9 3 ) * Z + B +
(Run using KEYS 0 to 9 to fire) 33-A*0.16,0
Now we have the problem of 200 POKE Z + B,2
rubbing out the stars ( * ) after 230 POKE Z + B + 3 3 - A *
each shot. Try:- 3 0 0 CLS 3 2 0 0.16,0
GOTO 1 0 0 . This rubs out the 3 2 0 GOTO 1 1 0
"fire" line backwards, not All the rest as BASIC program.
such a good idea. Try:- LIST
1 8 0 , EDIT, change line Now for the easy bit — a
number to 2 3 0 , N/L (new moving target. The easiest
line). LIST 2 0 0 , EDIT, change way is by filling up a string
line number to 2 4 0 and with 3 2 CHR$ and printing it
change 2 3 (CHR$ being at line 0 , 0 . then shifting it
poked) to 0, N/L. LIST 2 1 0 , along by letting the string =
EDIT, change line number to the string (2 TO) + the string
2 5 0 , N/L. LIST 2 2 0 , EDIT, (1) and reprinting at 0 , 0
change line number to 2 6 0 , creating a circular shift
N/L. Then add:- 3 2 0 GOTO movement. Add lines:-
1 5 0 AND 3 0 0 N/L.
6 0 LET BS » "
7 0 FOR B = 1 TO 16
Running the program, now
8 0 LET BS = BS + CHR$(INT
plots the gun fire, followed
(RND* 11)) + "
immediately by plotting blank
9 0 NEXT B
spaces in the same positions,
1 2 0 LET B$ = B $ ( 2
using the same routine. This
TO) + B$(1)
solution is acceptable though
1 3 0 PRINT AT 0,0;B$
in my opinion it makes the
whole firing routine too long, Running this, you will notice
doubling up the time involved that although you bit the
per shot. target, nothing happens so far.
It was therefore decided to The use of CHR$ codes 0 to
try blanking out the fire one 10 for the targets simplifies
step behind leaving only one the scoring where we PEEK,
" * " printed at any one time. then * 10, to give us possible
Try this:- 2 3 0 , N/L, 2 4 0 , N/L, scores of 0 to 1 0 0 ,
2 5 0 , N/L, 2 6 0 N/L, (to rub out
the last effort). Add lines:-1 9 0 W e now need to alter the
POKE ( B < 6 9 3 ) * Z + B + 3 3 - system slightly as rather than
A * 0 . 1 6 , 0 followed by N/L. poke onto the top line we need
Then EDIT, change the line to PEEK at the location firstly,
number to 2 3 0 and rub out then alter the BS accordingly.
( B < 6 9 3 ) * so the line reads Add to main program:-
2 3 0 POKE
Z + B + 3 3 — A * * . 1 6 , 0 then 180 FOR B = 6 9 3 TO «
N/L. This formula should STEP — 3 3
reverse the plotting for one 240 LET C = PEEK (Z + B)
step and blank out the " * " 250 POKE Z + B , 2 3
one step behind.
This works well, but it If shots are fired from all ten graphic symbols in the C$ 1 0 DIM E$ ( 1 , 3 2 ) miti
tends to give one the positions they hit B$ at (1), string, I've up'ed the numbers 30 LETC$="037ADHK(ne<
impression of a snow flake (4), (8), ( 1 1 ) , ( 1 4 ) , ( 1 8 ) , (21), by 2 7 to keep the entries RU" he i
drifting rather than a gun fire (25), (28), (31). As these simple, the 2 7 must be 1 10 PRINT AT 2,0;E$(1) V S
shot. It was decided to try numbers don't work out deducted from the code before 2 6 0 PRINT AT 2,1 2; iec
blanking out three or four conveniently the best solution use. The C $ , then, is rather " M I S S E D " AND C = 018"">
steps behind, to form a short is to store these numbers in a like a data statement that " H I T " AND C > 0 ; "=»
train and thus killing the snow string (C$1, and use the record holds the numbers used to C*10
flake effect. EDIT to change of the INKEY$ (A) to give us a alter the B$ (targets). W e also 2 9 0 LET B $ ( C 0 D E C $ ( A + 2 0
line 1 9 0 t o ; - 1 9 0 POKE pointer to pick out the number need to display the score (line -27) = " " 60
(B< 594) *Z + B + 1 3 2 - A * required from this string. 2 6 0 ) and blank it out before
0 . 6 4 , * and line 2 3 0 - CLS. To save us worrying about the next shot (line 1 1 0 ) . A line 00
3 2 0 = GOTO 1 0 0 . This again single and double figure of blanks is automatically
I decided wasn't the effect I numbers we simply use CHR$ produced for us in line 1 0. To complete the program w 1 0
required. codes. Rather than entering Add to main program:- just put in a few subtleties. I
54 ZX C O M P U T I N G S U M M E RISZXCOI
—
POKElng
330 PRINT AT 0 , 0 ; E $ ( 1 ) 80 LET C$ = C $ + C H R $
340 PRINT AT 0 , 6 ; " H I T (CODE B${X) + 1 2 8 )
POINTS ( - } T I M E " 9 0 NEXT X
3 5 0 PRINT A T 2 , 6 ; 1 0 0 SLOW
"OVERALL SCORE O F " 1 0 0 PRINT A T 0 , 6 ; A $ ; AT
3 6 0 PRINT AT 4 , 1 3;H-T 0 , 4 ; A $ ; AT 0 , 2 ; A $ ; A T
3 7 0 IF H - T > 3 0 0 THEN 0 , 0 ; A $ ; A T 0 , 6 ; B $ ; AT
PRINT AT 8 , 1 0 ; " W E L L 0 , 4 ; B $ ; AT 0 , 2 ; B $ ; AT
DONE" 0 , 0 ; B $ ; A T 0 , 4 ; C $ ; AT
3 8 0 IF H - T > 4 0 0 THEN 0,2;B$; A T 0 , 0 ; C $
PRINT AT 8 , 1 0 ; " V E R Y 1 2 0 CLS
GOOD"
4 0 0 IF INKEY$ < > " " T H E N 5 LET Z = 1 + PEEK 1 6 3 9 6
GOTO 4 0 0 + 2 5 6 "PEEK 1 6 3 9 7
4 1 0 IF INKEY$ = " " T H E N
GOTO 4 1 0 ORDINARY PRINTING
4 2 0 CLS
4 3 0 RUN 20 LET B = 2
30 FOR A = 0 TO 2 1
40 PRINT AT A , A + B;
50 NEXT A
The object is now to try and
FIRST M E T H O D POKE
beat the 5 0 0 score using the
keys in order 0 - 9 . To
complete the programme a 60 LET B = 3 4
title and instructions should be 70 FOR A = 0 TO 2 1
written in, at lines 4 4 0 80 POKE Z + A * B , 8
upwards and end with a 90 NEXT A
GOTO 4 0 0 instruction.
SECOND M E T H O D POKE
Rather than fill a string full
Same program as above but
of blanks w h y not DIM ( 1 , 3 2 ) ,
insert this line:-
this makes the machine do the
work for us. Then use String
(1).
75 IF PEEK(Z + A * B ) = 11 8
THEN GOTO 9 0
To extend on this idea why
not D I M a string ( 1 . 3 5 2 ) if w e
THIRD M E T H O D POKE
now print this at 0 , 0 ; w e will
Lines 5 to 5 0 as above then:*
clear the top half of the
screen. Also if w e print this
String (1) at 1 1 , 0 ; w e will 60 LET B = 3 3
clear the bottom half of the 70 FOR A = 0 TO 7 6 7 STEP
screen. B
80 P O K E Z + A + INT
A simple w a y to print a
(A/32),8
picture quickly is to print it via
90 NEXT A
a String. The easiest w a y is to
draw this picture on squared
paper. Then type in a direct
command FAST. Then line Conclusion
number for example:- The first method of direct
POKEing to the screen is
10 LET A$ = " faster than the "PRINT A T "
by far. The only way to print
this is now followed by the faster would be to resort to
rest of line being blanks. extremes. A single line of
"PRINT A T " ; " A T " ; " A T " to
So the first line is filled with print the lot in one line or to
blanks then the picture can be print a string containing the
drawn in the normal manner as pattern required, of course if
seen on the screen. When the you are prepared to do this,
picture is complete end the several lines of direct POKEs in
quotes then new line. W e can succession will still work out
now edit this line, rub out the fastest possible. The second
unwanted blanks at the method of looking to see if it is
32) limiting the firing to ten shots, We also wish to display the beginning and new line to safe to POKE takes time and
0 3 7 A D H K 0 one on each key to keep it fair. overall "hit points" = H and have our required picture in works out at about the same
each time the target moves the correct positioning. speed of the "PRINT A T " .
The shots information is held
w e clock up " T I M E " « T. The third method using the
2 0E$(1) by S$. We must now fire in
Add to main prograrn:- Try this simple program:- formula, surprisingly enough,
2J2; theorder 0 , 1 , 2 , 3 - 9. Add to works out a little quicker in
" AND C = 0 ; ma'" program:- response to the "PRINT A T " ,
IDC>0; " = ] 4 0 LET H = 0 10 FAST
5 0 LET T = 0 20 LET A$ = " " as well as being safe. The
1 4 0 LET T = T + 1 30 LET B$ = " " second method in some cases
DDE C $ ( A + 1 2 0 LETSS = " 0 " may have an advantage even
" 160 I F A $ < > S $ THEN 2 7 0 LETH = H + C* 10 40 LET C$ = " "
2 8 0 PRINT AT 1 5 , 2 2 ; 50 FOR X = 1 TO 6 6 6 though it is slowest. This is
GOTO 1 2 0 that it detects the sides of the
3 0 0 LET SS = STR$(VAL " T I M E = " ; T; AT 60 LET A $ = A $ + CHR$
1 7,22;"SH0T = ";S$; ((RND< 0.11# 24) screen which can be used to
S$ + 1) bounce or deflect a moving
e program w e 3 IF S$ = " 1 0 " THEN AT 1 9 , 1 8 ; " H I T PTS. = " 70 LET 8 $ = B $ + C H R $
;H {(RND<0.4)*24) object quite easily.
„ subtleties B GOTO 3 3 0
55
U M M E R1983zxCOMPUTING S U M M E R 1982
ONE ARMED
BANDIT
Winnir
:OIN
JELL
:ASTLE
.EMON
:HERRY
DRANGE
Vt random
vill appear,
hen choos
he barrels
o hold bar
'ress " Y '
O hold bar
•ress "Y"
O hold bar
•ress "Y*
e. To hold
arret 3 Pn
List of
ZX C O M P U T I N G S U M M E R 1)x C O M P U T
This is a ZX80 version of the pub
game. Three barrels are rolled on
which are marked six symbols.
According to the symbols
displayed, different payments are
awarded.
Winning Positions
ZX COMPUTING S U M M E R1)xCOMPUT
p
16K Cames
58 ZX C O M P U T I N G S U M M E R IS ZX COI
REM "OTHELLO" L E T U = P -I J *D (I)
St_GU L E T R f U i ^T
GOTO 1103 LET R=INT (U/10)
LET 5 = 0 LET C = U - 1 — 1 0 * R
IF N O T R (P) =0 T H E N R E T U R N PRINT RT lfatR.SfSfC;^*
IF E = 1 T H E N G D 5 U B S 0 0 NEXT U
FOR 2-1 * RETURN
L E T G>=P FOP 1-0 TO 3
LET J - l P R I N T RT 19tl.0;D$
I £T Z - D ; I) NEXT I
L E T
P R I N T RT 1 3 . © ; " Y O U H R V E S
IF = 3 T H E N G O T O 1*70 I HRUE " ; 5 M
IF RiGCi = T T H E N G O T O 1 5 0 RETURN
LET d = J 1 L E T N=G>
I GOT i 1 0 0 LET E=0
f LET 55 =-S
- * J -1 LET T=M
l IF E = 1 T H E N G O S U B 3 0 0 FOR R = 1 T O S
I NEXT I
FOR C = 1 T O 6
! IF E - 1 T H E N LE" 5 U = 5 U + 5 * 17 ~ L E T P = H-C*-10*R
,* iT =M ) G O S U B 4.0
IF E = 1 .ET <T = 7r S < N T H E N G O T O 6 1 0
<* tT=U) IF S + I N T ( R N D * 3 ) = N T H E N GOT
I IF E = 3. T H E N G O S U B <110
I RETURN L E T N=rS
l IF T = U T H E N LET R $ - " O " LET X = P
I IF T =H T H E N L E T R$="*" NEXT C
! IF T s M "~HEN LET NEXT R
I IF T - U T H E N L E T B $ = " Y O U IF N = 0' T H E N G O T O BSO
t P R I N T RT 0 , 0 ; D $ LET E = 1
i P R I N T RT 0 . 0 ; B $ ; " C H O S E R ; LET P=X
i (C+37) L E T Rs'l N T (P/10)
t L E T R CP) - T LET C=P-1-10*R
l P R I N T RT 1 + 2 * R , S + GOSUB 40
f L E T S U = 5 J t l * <T=U>
FT S M = 5 M + 1 * £T--M)
RETURN
F O P J a l T O <J
9 5 0 LIF E T
S - O T H E N GOTO
E = 1
SIC 1360 IF X = U T H E N P R I N T O";
960 PRINT U$ 1370 IF X = 0 T H E N P R I N T W> * * •
Fit .»
9 7 0 G O S U 6 4-0 1380 LET SU=5U+1*(X=U)
9 6 0 1390 LEV SMsSM+1*(XsM)
G O T O IF1 5 0
5 M + 5 U = 6 4 OR S M * S U = 0 T H E N 1400 NEXT C
9 9 0 IF U 0 1 4 10 PRINT
1 120
I
"YOU H I S S E $ = " " T H E N P R I N T R T O..0,; NEXT R
9 9 5 IF U t - D YOUR TURN" 1430 PRINT
1000 ' " T H E N G Q S U E 4-10 1440 PRINT "YOU HRUE " 'U; I Hft
1 0 1 0 I N P U T H^aCTHgr.t
P R I N T FOR flHBK" UE S H
1020 $ 14-50 L E T Di="
1 0 3 0 PIF R I N T T R B
THEN GOTO 1500
8.; "THINKING. .
1040 GOTO 500 1460 GOTO 800
1100 D I H R ( 10©J 1 5 0 0 IF S M > S U T H E N PRlNfT
1110 DIM D ( 8 ) 1 5 1 0 IF S M < S U T H E N PRINT CONGRfl
1120 LET D ( 1 ) = 1 1 TULRT10N5"
1130 LET 1 5 2 0 IF S H = S U T H E N PRINT ' - R DRfi
114.0 L D (2'} =1© U - "
E T D 13'i ^9 1530 S FOP
THE ANDREW
BUFFER DEVELOPMENTS
MICRO SHOP ZX81
2X8 BIT P A R A L L E L I N P U T / O U T P U T BOARD FEATURES I
(NEXT TO STREATHAM STATION) INCLUDE:
16 P R O G R A M M A B L E L I N E S
NEW SOFTWARE SHOP EXCLUSIVELY FOR E A C H L I N E M A Y BE SET A S A N INPUT OR O U T P U T Get
UNDER PROGRAM CONTROL S">a
F U L L Y TTL COMPATIBLE
ZX81
w r il
A M U L T I T U D E OF APPLICATIONS I N C L U D I N G : mod
I
?)( c
lTURES
Get your digits into order in the on a TRS 8 0 and further it so that instead of just stopp- message.
smallest number of moves. modified by Tim Hartnell to ing when you get the digits into A further modification
This program was originally make it run in Sinclair BASIC. order, the computer prints would be a 'lowest score'
written by Don S c a l e s , Once you've got it working as them out in inverse graphics, feature. Pressing any key at the
modified by H J Garwood to run listed, you might like to modify and gives you a congratulatory end will give you a new game.
ms, arid I time you convince somebody routines, and "Graphics ride volved in such things at such an tions (you can see this is |ust
gramm-l to buy a ZX81, get them to buy again!" early stage — then the priority the sort of book your teachers
/wards a I the book as well. . . and then The book m e t h o d i c a l l y of m a t h e m a t i c a l operators would leap on), and GOTO and
ctorials, I borrow it. The cartoons are covers the ins and outs of the (such as multiplication before FOR/NEXT loops.
jns and ) great, and who knows, you Z X 8 1 starting with general in- addition) is discussed. Already I T h e book w o u l d be, I
v games may pick up a trick or two. formation on what computers can sense newcomers flipping believe, fairly heavy going,
mntandl "PEEK, POKE, BYTE and can do, followed by a short in- past this section in exaspera- despite its simplicity, for a per-
ling very I RAM", Shiva Publishing Ltd, troduction to computer lan- tion, looking for something a lit- son who has just picked up a
The pro-1 ISBN 0 9 0 6 8 1 2 1 78. guages and binary arithmetic, tle more directly relevant to computer for the first time, but
and then a brief section on what their needs. when used as a text to guide
and' well} ZX81 BASIC BOOk a program is — using a sample
'program' describing certain
W e are already up to chapter pupils who have the benefits of
a live teacher on the spot,
The ZX81 BASIC Book, pub- eight (some of the chapters are
actions by Mickey Mouse in a only one or two pages long) would be very useful indeed. It
n and a t - 1 lished by Newnes Microcom-
Walt Disney cartoon. Once before the first particularly is difficult to imagine why the
k, w h i c h l puter Books, is more staid in ap-
you've traversed this ground, useful information for first-time material has been presented in
success-1 proach than the others review-
and worked out how to plug bewildered users is presented. this order, with GOTO assigned
i n g yet ed in this section of ZX Com-
your computer into the telly, The use of LET to assign values a lower priority than converting
manual. I j puting, and for that reason is
the book gets down to work. to variables is e x p l a i n e d , radians to degrees, and loading
of great sure to appeal to schools,
Direct input commands are f o l l o w e d (in s u b s e q u e n t and saving programs is con-
new ZX Although the approach is fairly
covered, and — in a section chapters) by such things as the sidered less important than fin-
the book straight, the book is far from
sure to confuse newcomers use of commas in PRINT for- ding natural logarithms of
i a couple dull, with witty (?) chapter titles
who don't have a maths back- matting, the use of the EDIT square roots.
enced ZX like "Gone out, bizzy, back
ground, or don't want to get in- function, trigonometrical func- If you are teaching a class of
that next soon" to introduce sub-
A.1 V" R
c c
ZX C O M P U T I N G S U M M E R 19^
• • •
ZX80 Programs
ist for the
feel good
luct their
5 book is |
AREA CALCULATOR
jwed the
critical of
vided on-
ith many The following program, produced
for the Z X 8 0 and using only the
hen learn-
1K of RAM, will calculate the area
tricks to within a polygon. The computer
ium into plot* the point! whose co-ordinates
Wl. Roger have been entered, using a 3 6 10 PRINT " H O W M A N Y V E R T I C E S ' " 220 FOR O 0 TO V t
arned the symbol code, and the area is 20 INPUT V 230 lFY-Y(OIANDX X ( 0 ) 1 H E N G O T O 270
packing, primed underneath. The sign of X CLS 240 NEXT Q
t of them the area will be positive if traced 40 PRINT " G I V E CO O R D I N A T E S " 250 PRINT "
this little anticlockwise and negative If all, 50 DIM X(V-l) 260 G O T O 280
or any, of the figure is plotted
60 DIM YIV1I 270 PRINT C H R S I Q + 1561.
clockwise. On the display the
divided in- plotted points are displayed in the 70 FOR N = 0 TO V 1 280 NEXT X
te and for- same code as the axes and are 80 I N P U T XIN) 290 PRINT
iore frills; numbered according to the order 90 INPUT Y I N ) 300 NEXT N
lata files; of entry. 100 PRINT " r , X ( N ) ; " . " , Y ( N ) , " l " 310 F O R N 0 1 0 31
; Utilities In the entry stage of line 8 0 and 110 NEXT N 320 PRINT CHR$! 156 * N l ,
:tion titles 9 0 , inputs of greater value than 3 2 120 I N P U T AS 330 NEXT N
how wide and 21 respectively will not be 130 CLS 340 LET Z = 0
n is in this displayed although the area is 140 FOR N = 1 T O 2 0 350 FOR R ~ 0 TO V 1
still calculated. All the input
elude the co-ordinates are repeated after
150 LET Y e 2 1 N 360 LET S - R + 1 - ((R + l l / v r v
s (CRAPS, entry tor checking, N E W L I N E will 160 PRINT CHRS( 156 + Y) 370 LET T s R + 2 - H R + 2 I / V ) * V
RESCUE!,! cause the program to continue if 170 FOR P = O T O V-1 380 LET Z - Z + X l S l ' I Y l T ) Y<R)i
of the sur- they are correct. 180 IF Y = YIPI T H E N G O T O 210 390 NEXT R
ind useful 190 NEXT P 400 PRINT " A R E A l S " . Z / 2 .
V AT, 200 G O T O 290 410 IF N O T I Z / 2 C 2 Z THEN PRINT " 1 / 2 .
lit Cards, 210 FOR X 1 TO 31 420 PRINT " S Q U A R E U N I T S "
id Payslip.
s are very
s Roulette,
i very odd
simulations
i enter your
:k as t w o
all this is a
one which
tment time
ZX81 1I6Ik
at Can I Do
nputer Ser-
SOFTWARE
All our software comes w i t h full instructions and is SAVEd and ready to RUN, no
need to spend hours laboriously typing in from books.
ZX-81
P A C K W t tKkjOn an <* CONTROL TECHNOLOGY -
AiR TRAFFIC C O N T R O L A r m a i a d radar acraan of Duty
—Txr\ ihcwrv you tXWfl planaa H O
' W A D E R S SELF P L A Y . P H O N E B O O K
land
haao fnandt
PERSONAL
trC rMtivaa n u m b a * onmc m t r t i D A T E 81 C O M P U T E R SCIENCE
eompuw daeng prov " P** *or you'
Alt O N L Y « »
U M M E R 1982 ZX C O M P U T I N G S U M M E R 1982 66
News
Clive sets
the pace
Uncle Clive will be donning his and finishes in the Market
sweaty tracksuit to set the Square at the Guildhall Steps.
pace in a half-marathon to be
held in July. Co-organised for the
The half-marathon, to be Festival by Cambridge City's
included in this year's recreation department and the
Cambridge and Coleridge
Cambridge Festival, will be
Athletic Club, the event is
sponsored for £ 5 0 0 0 , by open both to club-based
Clive's company — Sinclair runners and general
Research — which is, of enthusiasts. Entries have
course, based in Cambridge. already been received from as
The race is expected to attract far afield as Wales and
a number of top-class runners Durham.
to the city. Clive will be
among an expected 2 0 0 0 Uncle Clive told us his
competitors following a three- company sees its sponsorship
lap course through the city's of the marathon as oart of its
historic streets. Starting in commitment to supporting and
King's Parade, close to developing cultural life of the
Sinclair's offices, it includes a city. It is also sponsoring, as
riverside stretch along part of the Festival, a concert
Chesterton Lane, the 'Backs', in King's College on July 3 1 . 1 •Lem
Clive Sinclair
Timmx.
Sincfon
Schools
handwritten notice saying that echnoli
Clive's people would not be It als
Jncle C
lap it up
there.
I found a disconsolate set Ithougl
of four Z X 8 1 owners — who he ZX t
are very much in a minority w eye
among computer users in pparer
More than 2 5 0 0 UK
America — sitting sadly in the onderi
secondary schools have
booth swapping Zee-X81' uiggly
bought Z X 8 1 s to give their
stories. he besi
pupils hands-on computing
One enterprising Z X 8 1 w forr
experience.
owner in the States, Eric mbol t
Last May, Sinclair Research dersto
Reiter of 16th Avenue, San worked out a deal with the
Francisco, had a tiny, one-yard et been
educational distributors Griffin mencar
wide booth, in which he was and George to sell Z X 8 1 s at a
showing his expansion board, cut price to schools. The Sincla
which is suitable for ZXSOs. scheme, which is now closed, OMPlJT
ZX81 s and the Z X 8 0 - 'arketm(
aimed to provide a wider and
lookalike, the MicroAce. The iat the I
more economic choice of
expansion board was a •uch gre
complicated, spaghetti- equipment than was available
under a government-assisted schools that insisted on S marke
junction type motherboard all schools." ise in th
which was controlling little scheme for the purchase of buying a Z X 8 1 . " W e believe that the
computers. Although the gh-tech
lights and squawkers. Putting it diplomatically. success of . our scheme in
government thought it was . . n g i n g fr
A series of seminars were Uncle Clive said: "Although
wonderful for schools to buy bringing microcomputers to^ r o s c o p (
held throughout the show. welcoming the government
micros, it was not prepared to many schools vindicates OUfeyu q u i
One talk was given by the initiative, we felt it did not
give cash for the purpose to fully account for the needs of approach as both practical %mpetito
president of Mindware,
economic." .mputer
66 ZX C O M P U T I N G S U M M E R 11
COMPl
News
Users'
clubs • EZUG (Educational
A network of users' clubs for
the Z X 8 1 has sprung up in the Z X 8 0 / 8 1 Users' Group), Eric
UK. The largest group, the Deeson, Highgate School,
National Z X 8 0 and Z X 8 1 Birmingham 1 2. Send a large,
Users' Club, produces a stamped, addressed envelope
monthly magazine Interface, for details. EZUG also caters
acts as an 'umbrella' club to for the BBC Microcomputer.
publicise local groups, and
• Roger Pyatt, 2 3 Arundel
assists in the presentation of
Drive, Orpington, Kent ( 6 6 )
the ZX Microfairs. The
national club is at 4 4 - 4 6 Earls
20281.
Court Road, London, W 8 6EJ, • Austin Knott, 2 6 9
and you can get a sample Telegraph Road, DEal, C T 1 4
issue of Interface, along with 9EJ.
details of the club, by sending • Christoph Moeller, Gross
€ 1 . 0 0 to the Earls Court Road Kurfurstenstrasse 4 1 a , 4 8 0 0
address. Bielefeld 1, Germany.
- The North London Hobby • Danmarks Nationale Z X 8 0
Computer Club has a og Z X 8 1 Club, Skovmosvej 6 ,
Z X 8 0 / 8 1 users' group 4 2 0 0 Slageise Dk Denmark.
meeting each Monday night
from 6 - 9 p.m. It is held at the • Steve Brumby, 3 8 Eastfield
North London Polytechnic, Road, Messingham,
Holloway Road, London, N 7 Scunthorpe, Sth. Humberside.
*t»m Tarshis, Executive Vice President in charge of operations. (diagonally opposite Holloway • Ken Knight, 2 2 Mount
Timex, at the press conference announcing his company's tie-up with Road tube station). Street, Aylesbury, Bucks.
Sinclair Research
Most local computer clubs H P 2 0 2SE ( 0 2 9 6 5 1 8 1 ) .
Timex buys it up
Sinclair Research have signed For the time being,
have a large percentage of
Z X 8 1 owners, so you are sure
to meet fellow enthusiasts if
you get in touch with your
• David Blagden, PO Box
1 5 9 , Kingston upon Thames,
Surrey, KT2 5 Y Q .
• Anthony Quinn,
a deal with Timex in America Sinclair's Boston-based US local club. If you'd like to start Heckenrosenweg 6 , 3 1 7 0
to get the ZX81 sold through subsidiary will continue to sell a local club, write to the Gifhorn, W . Germany.
some 1 7 1 , 0 0 0 retails outlets the ' 8 1 by mail order until National Z X 8 0 a n d Z X 8 1 • Conrad Roe, 2 5 Cherry
in the States. Very shortly, Timex's o w n sales reach Users' Club so they can Tree Avenue, Walsall, W S 5
agreed levels. The Boston publicise your address. It will 4LH.
lucky Americans will be able
group will then concentrate on also be listed in future issues • Ian W a t t , 1 0 7 Greenwood
to buy ZX81 s from the same
selling the new flat-screen of ZX Computing. Road, Clarkeston, Glasgow.
shops which sell jewellery,
telly. This is expected to be Local clubs that w e know • J. Palmer, 5 6 Meadowfield
perfume and Timex watches.
available just before about include: Drive, Edinburgh ( 0 3 1 - 6 6 1
Uncle Clive will get a 3181).
royalty on all sales under the Christmas.
• Leeds Microcomputer
new contract, which covers Users Group. Meets
DCP
a
•
c
M icr odevelopments
t
a
Packs
Stephen Adams takes a peek and
a poke inside this system which
is based on a single input/
output port and intended for a
wide range of educational and
control applications. It can be
used — with the other packs
available to plug into the port —
to monitor heatf light and
voltage, as well as activating
alarms and motors, and making
sounds.
and LEDs. A suitable circuit devices. The port connectors pack or another port to work as
The Basic V Pack diagram is included in the leaflet on the back are designed to be it cannot plug directly into t N
This is 4K of dynamic RAM (2 x that comes with the port. It is used by two other packs ' A ' expansion port of the com-
6 1 1 6 s ) to add to the basic 1K very easy to use and comes in a and ' C ' to provide extra puter. It is in a tough black bo*
provided with the machine. robust black plastic box 3)4 * facilities, but only one pack can like the 'P' pack, but with the in-
This gives a total of 5K, the 3% x 1% inches. Demonstra- be used at a time. put and output sockets 2 mm
maximum amount of memory tion programs are given, and wander sockets. These wander
allowed by the system. It also with the accompanying infor- The A' Pack sockets are the same as used
on some multimeters. They
provides separate input and mation any user should find it
output ports at the back of the easy. The 'A' stands for analogue and also take the connection plugs
'P' pack which are memory This is a basic building block the pack provides an interface used by schools and colleges to
mapped. Because the port is for DCP's control system and between the digital world of the connect up science experi-
memory mapped, it can be although it provides only 5K of computer and the real world we ments.
PEEKed and POKEd to get infor- memory, this should be more live in. The 'A' pack is used for
mation to and from the com- than enough to control most The 'A' pack requires a 'P' measuring a voltage between 0
puter. It makes no difference if
the computer is a Z X 8 0 or a
Z X 8 1 and it will work with a 4K Fig. 1
or 8K ROM. It is not possible to
connect anything else to the
computer without using a Output f r o m port set t o 2.5 volts.
motherboard as the only other
connectors on the 'P' pack are
0 . 1 molex pins for the port.
These pins are about % inch
long and there are 10 for input RESISTOR X
and 1 0 for output. The pins are
connected to the eight data
lines and also provide + 5 and 0 Input t o ' A ' pack.
volts. They can only drive one
TTL gate from each output pin.
The ports address is any-
where from 2 1 5 0 4 to 2 2 5 2 7
as the single port replaces 1K of
KNOWN RESISTOR
RAM. The plug connections
used for the port are readily 0 volts.
available from other sources
than DCP.
The port can be demon-
strated by the use of switches
ZX C O M P U T I N G S U M M E R 1982
and 2 . 5 volts. This will produce Table 1.
a number between 0 and 2 5 5
on PEEKing at the INPUT from
the port. There are + 5 volts
and 0 volts connections from
the pack, so these can be used 45 ma.
to create the voltage required. Port 'P' pack
These should be used with care
as they may cause the crash of ' A ' pack
the computer if too much cur- 80 ma.
rent is taken.
The output of the Digital to 'C' pack 775 ma. (Max.)
Analogue converter will con-
vert the number between 0 and
255 into a voltage between 0
and 2 . 5 5 volts. This can be ad-
justed within the port, if it is not
correct, and a complete circuit pack, but also burn out the 'P' either an answer somewhere
diagram is given. The accuracy pack as well. Solving Equations near what you believe the cor-
is ± 5 % on both the analogue These devices are intended for rect answer to be, or — if there
input and output. use in educational or control is more than one correct
The resistor c o u l d be purposes. Games could be answer — a number near the
measured using this device by another possible use, but the This clever routine, written by answer you are seeking. Then
connecting them as shown in price of these packs might put Jeremy Ruston, uses Newton's press NEWLINE and sit back
Fig. 1. By knowing the voltage that out of bounds. The limit of method for solving equations. and watch the fun as the com-
across the known resistor and only 5K of RAM and only one Enter the equation you want puter verges t o w a r d s the
the voltage output by the port might prove restrictive in solved for X when prompted by answer.
analogue port, the resistance use, but up to 1 2 8 different line 1 0 , then — in reply to the To try it out, enter X * X - 5
can be calculated. As the 1 bit devices can be controlled. prompt from line 4 0 — enter a (to find the square root of five)
resistance of the unknown The boxes are robust and starting position for the Z X 8 1 or X * ' 3 - 2 7 . 6 to find the
resistance rises, the measured could be used in schools with- to work from. This should be cube root of 2 7 . 6 .
voltage across the k n o w n out needing a set of expensive
resistor will fall. The computer plugs and sockets. I have
can then be used to work out L- RTF-.N W E W T O N S M E T H O D - F O R
doubts, however, over the in- S O L ^ X H G EOLTRT T O N 5
the unknown resistance. puts to the 'C' pack. If any REM BY UEREMY RUSTON
voltage over + 5 volts is used, PRINT "ENTER P FUNCTION ";
The C Pack some form of protection will be
required to stop the port blow-
20 INPUT
30 PRINT
FS
F$
The 'C' pack again requires the
ing up. 4-0 P R I M T "ENTER R STRRTIN6 POX
The documentation that M"
use of a *P' pack or another 50 INPUT S
port. The ' C pack can plug comes with the port is very
clear and simple to understand. 60 PRINT 3
directly onto the connectors at 7"0 P R I N T '* I N P U T MAXIMUM ERROR
the back of the 'P'. The leaflet included with each
pack details its uses and gives a
The 'C' pack provides eight
program to demonstrate its ©0 INPUT ERR
relays which can be controlled
capabilities. The current drawn 90 PRINT ERR
by the output of the port. The
by these packs is shown in table
1O0 PRINT RT 10,10;3
relays are turned on by making
1. DCP packs cost £ 3 7 . 9 5 for
110 LET X=3
any of the eight bits Binary 0 . 120 IF R B 5 VURL L'F$.» > -: E R R THEN
the price of the 'P' pack, 3"! O P
The outputs from the back are
£ 2 9 . 9 5 for the 'A' pack and 130 LET T=URL LF$>
by the same 2 mm sockets as
£1 9 . 9 5 for the 'C' pack. Both 140 LET X =X +0- 0 0 0 0 1
used on the 'A' pack. The out-
'A' and 'C' packs must be used 150 LET B = (URL TF$> -T> Y 0 . 0 0 0 0 1
puts consist of eight single con-
tact switches, which connect
with a 'P' pack or other ports. 163 LET 5 = 3-T.'B
to a common wire. They are not
1*7® GOTO 100
connected to the computer at
all. The contacts are normally
closed and can carry 12 volts at
1 amp maximum. Therefore
when the computer is switched
on and the output from the port
is 255, all the switches are
closed. I would have thought
this would be a disadvantage in
a controlled situation, as all the
devices would be turned on
under no control from the com-
puter.
The inputs consist of a set of
eight resistors connecting each
of the input connectors to 0
volts. This means that when
PEEKing the port with nothing
connected the user will see 0 .
There is no buffering between
these input pins and the input to
the port, so that the application
of any voltage above + 5 volts
could not only damage the 'C'
ZX COMPUTING S U M M E R 1982 69
Hypno Tim Johns from
This program, instead of using
^T°bVi°US
r u i N i , makes use of POKE
putting the code values of the j
characters directly into the
of
I ^
• r - r - . i ,
70
ZX C O M P U T I N G S U M M E R
ZX
i6KCames^
2 0 0 POKE
T O 3 4
ill IE? xlr*T-3**»
11 LL
tng i * "
10 LET
of
KE, W + i i i Rgg r
the li |gs5e 30*
the 21 £ f t ergiiS 3 l o NEXT N T O
t
his 270 FOR ^ i
mg
i
ay. i l l <«*<>••>
cts ! !
31® ^^
i of ill SSKI
in
T
jnd ill t ^ T l ^ ^ * * " ° ^ 121 fcg 1=1
fOf
ing §11
ne,
or
the
ttty ill POKE ^ ^ ^ * '
led
U i J J J, J J i J . Jl i . i J
'A^/ff/T
^ C O M P U T I N G S U M M t H 1982
MONTH I
PROGRAMMERS' TWO-
PORTABLE POWER?
STEP
o
After years of writing books on computers
and awarding his famous 'White Elephants' O K , so you've learnt to program in BASIC.
to the industry, Adam Osborne finally took Now, perhaps, you'd like to have a g o at
the ultimate step and produced the assembly but you're put off by the fact that
Osborne I. Despite the fact it is portable, you can't alter your programs with the same
well. almost, and fairly reasonably priced ease as you can in BASIC. Well, what you
as hardware goes, the main attraction seems need is our two-pass assembler which lets
to be the fact that you get several hundred you write and modify the assembly code first
pounds' worth of software thrown in for free. and then turn it into machine c o d e without
Having humped the system up hill and destroying your original.
down dale and generally put it through its .So, if you'd like a professional software
paces, our reviewer will hopefully have tool to help you with your assembly
recovered sufficiently to put pen to paper language programming, don't miss out on
and report on his findings. our next issue!
Keyboard Review
Crofton's Adaptakit is housed with the review model, but it
m a neat, matt-black metal box,
around 1 2 inches by six, which
The touch-sensitive keyboard is appears a very useful addition)
which is attached to the
holds the Z X 8 1 . There are 54 one of the main sources of keyboard case by two self-
keys on top which duplicate all
tbeZX81 keys. Additional keys
criticism of the ZX81. is an tapping screws to prevent the
Z X 8 1 PCB or edge connector
are provided for many func- external keyboard the answer? becoming strained. This plate
tions such as GRAPHICS,
COPY, right and left cursor and
Tim Hartnell investigates should minimise memory
failure.
EDIT, as well as two shift keys Crofton's solution to the All in atl this is a nice
and a BREAK/SPACE bar at the
bottom of the keyboard. problem. package, and one which turns
your Z X 8 1 into a 'real com
The keyboard is not com- puter' — or at least makes it
pletely satisfactory to use, which provides an output at a dard d o m e s t i c t e l e v i s i o n look like one. The keyboard
because the 'feel' of the keys is level suitable to interface with receiver. could be, as I suggested, bet
poor, they tend to rattle and almost any standard video T h e k e y b o a r d is f u l l y ter, but in its present form it is
bounce somewhat, and the monitor. assembled when you get it, but an enormous improvement
box-top is not raked, so you are A nice touch is the LED in- the sticky-backed key labels over Sinclair's one. The extra
working on a flat surface. dicator to show power on. It is have not been attached, so you keys are very useful and make
Despite these minor criticisms, unfortunate that a separate, can follow the suggested game responses much quicker
the keyboard makes working and more robust, power supply layout, or modify it to your own than on the standard keyboard.
with the Z X 8 1 a much more was not provided onboard, as requirements. The Z X 8 1 PCB At £ 4 2 . 9 0 (including VAT and
pleasant occupation than it is this would be likely to be of must be removed from its case, p & p) this is a worthwhile pur
when working Sinclair's stan- more general value, I would and the existing keyboard rib- chase if you intend to make
dard membrane keypad. Once suggest, than the video output. bon cables disconnected from heavy use of your Z X 8 1 and
you get used to the new posi- You still have to use the Sinclair their connectors. The PCB is have access to a video monitor.
tions of some of the keys, and power supply and leads, which then bolted onto the Crofton A kit version is available for
you become familiar with the plug into the Z X 8 1 through keyboard PCB. Short lengths of £ 3 7 . 1 5. If you don't want the
double SHIFT keys and the holes in the Adaptakit's left- ribbon cable then connect the hassle of fitting the whole lot
separate function keys, you'll hand side. two PCBs. Once you've install- together, you can send them an
find you'll be working much The video amplifier circuitry ed your Z X 8 1 into the key- extra £ 8 . 6 2 plus a complete
more quickly than in the past. brings the video signal level up board, your memory pack and cased Z X 8 1 , and they'll send
The computer is bolted into to a standard 1 V peak-to-peak printer may be plugged into the you an Adaptakit with a Z X 8 1
place within the case, produc- composite. This enables the main board via a slot in the back already wired in.
ing a solid package which does output to be fed directly to a of the keyboard case. A RAM Crofton Electronics Ltd., 35
not slide around the desk. There video monitor rather than via support plate is also supplied Grosvenor Road, Twickenham,
is a video amplifier onboard, the internal modulator to a stan- (although one was not provided Middx. ( 0 1 - 8 9 1 19231.
ZX C O M P U T I N G S U M M E R 1982 73
Hardware support
QuicksHva
Quicksilva —
The man behind it
In August 1 9 8 0 , Nick Lambert
wanted additional money for
his Z X 8 0 . Sinclair's 3K pack
was too expensive so Nick
decided to build his own. This
was the beginning
Quicksilva, a company which
of
Tim Hartnell interviews Nick Lambert,
n o w has f o u r full-time
employees, and which has led who started out building electronic
the way in providing im-
aginative hardware modifica- classical organs for a living, and now
tions for the Z X 8 1 .
Nick was an electronics en- runs his own company stretching ZX81
thusiast mainly interested in
electronic music, when he hardware beyond Sinclair's
bought his Z X 8 0 - the only
computer he could afford.
" I realised quickly that the
specifications.
memory as supplied on the
Z X 8 0 was very limited, and be- few more products together to
ing unwilling to endure any go with the Z X 8 1 . "
more Sinclair delivery delays, One of Nick's secret vices is
and because the price was high, arcade games.
I decided to make my own 3K " I thought a good moving
pack", Nick recalled. graphics game would go well,
"It took a couple of weeks to and decided to do Defender,
produce the first prototype, and because it was my favourite. At
I then decided that as I was about the same time, I came up
building one for myself — and with a sound board for the
there didn't seem to be any Z X 8 1 . It had been in the back of
others on the market at the time my mind for quite a while."
— I should make it a real project Nick soon discovered that
and produce the memory packs between admiring a game in an
as a business." arcade, and producing a version
Nick had had some ex- for a somewhat limited home
perience with PCBs, and with computer lies a vast gulf, filled
getting production lines mov- with blood, sweat and tears.
ing. His first advertisement for " D e f e n d e r took three
the 3K pack appeared in the months to write. I did most of it
users' club magazine Interface, myself. By the end I was getting
and Quicksilva was underway. pretty sick of it, and needed
Nick swapped a memory pack considerable moral support to
to pay for that first ad, and sold get the thing completed. Three
around 5 0 of the initial design. months it took, before I finally
" I was charging around £ 4 0 got it running properly."
at first — Clive's 3K pack was But the trouble was worth it.
£ 6 4 at that stage — but after "I reckon we've sold four or
Clive released his 16K for five thousand", said Nick,
£ 4 9 . 9 5 1 gradually dropped the "Most of our subsequent soft-
price. It is now £ 1 5 . Overall I ware products have been based
guess I've sold around 4 0 0 3K on arcade games. After Defen-
packs." der we produced the program-
The electronic organ mable character generator
business was fairly quiet, and
Nick began to see the possibili-
ties of making computer peri-
board. It came out just before
the South Bank Sinclair Show.
It has gone well, just about
/
pherals as a business. anybody seems to buy it.
"Although my memory pack "Schools, in particular, have
business was OK, and it sup- shown great interest in the
plemented my income nicely, it
was not something I could do
character g e n e r a t o r " , said
Nick. "There are many educa-
/
full time at that stage", said tional applications, such as
Nick. "Nevertheless, I was en- drawing equations, where the
joying it. I realised then that character generator goes down
working for myself in this way well."
was the only way I would be \
happy.
" I was doing some contract
High Resolution
testing work on Winchester But white 'just about any-
discs when the Z X 8 1 came body' appeared to find a use for
out. I'd always thought of the character generator, Nick
myself as 'testing the water' by noticed a difference with the
selling the 3K packs, and that next product his company
had gone OK. so I thought I developed, a high resolution
should expand my line and get a board.
74 ZX C O M P U T I N G S U M M E R 1982
Hardware support
"The hi-res board seems to crowded as more and more
go to a noticeably different kind people came in to see the
of 'clientele'. These seem to be marvellous board do its tricks.
people who know more about The board is simple to use.
computing, and have been You call it with a USR com-
waiting for someone to produce mand, and the board follows in-
a hi-res board." Even though structions stored in English in a
the high resolution board costs REM statement. For example,
£85, more than the computer, REM BLACK CLEAR MOVE A A
Nick believes it has sold well DRAW B B, when A is zero and
because it and the computer B is 1 0 0 , will clear to a white
can perform better than many area, and a line will be drawn in
computers costing much more black from the top left hand cor-
than the combined price of the ner (0,0) to somewhere near
board and Z X 8 1 . "Compared the middle ( 1 0 0 , 1 0 0 ) .
with other machines which pro- The graphics commands,
vide the same facility, it is about and what they do, are:
a third of the price", he said. BLACK — sets the pen colour to
Quicksilva's latest project is black.
its most exciting one — a ZX WHITE — sets the pen colour to
colour board. white.
"We'll definitely have one CLEAR — clears the whole
soon", said Nick, " W e ' r e going hi-res display to the opposite of
for eight colours. It is still in the the pen colour.
design stage (early March) but MOVE X Y - This moves the
we're well on the way to having current co-ordinates (the hi-res
a working prototype. cursor) to X Y but does not
" W e hope to have one work- draw anything.
ing at the next Microfair. It will PLOT X Y — This plots a single
probably have two kinds of con- point in the current pen colour
trol. In one, you'll be able to at the X Y co-ordinate specified
specify a particular colour for DRAW X Y - This command
each position on the screen. In draws a line in the current pen
the other, we're going to have a colour from the current co-
character code mode to specify ordinate to the new co-ordinate
a particular colour map. It will specified by X Y.
be controlled by simple POKEs. BOX X Y — This command,
The character code map idea is which is found on few micros,
a good one as it gives you the draws a rectangle from the cur-
same facility as you get with rent co-ordinate to the new co-
the characters board. You can ordinate (X Y) which sets the
use it with existing programs." position of the opposite corner
The Quicksilva idea is to of the box.
allow computer users to load UP, DOWN, LEFT. RIGHT
the colour and/or the character These four commands move
generator software, and then the whole hi-res screen by one
load in any game the user pixel in the direction specified.
already has to take advantage Anything moved off the screen
of the programmable charac- will be lost.
ters and the colour. SCROLL - Scrollsthe lower 24
The company which started lines (3 x 8) by eight lines up-
off with an ad swapped for its wards, one at a time, and sets
first product now is four people the current print position to the
working full t i m e . N i c k ' s start of the bottom line. This
sidekick is John Hollis, who has provides a three-character line
done most of the design work. text window at the bottom of
"He's done everything ex- the display for prompts and
cept the characters demo soft- messages.
ware since the t w o of us started COPY — This c o m m a n d ,
up with Defender and the sound believe it or not, copies the
board", said Nick. " A s well as whole hi-res screen to the ZX
that we have Mark Eyles, the printer.
production manager, Chris Lon- If you want to get an idea of which you trigger with a simple To make this simple system
don who is a permanent 'PCB just how good the Z X 8 1 can USR command, A test pattern even simpler to use, all of the
production engineer' — or at be, take a good look at the pro- is drawn and the message " O S graphics commands can be ab-
least that's what he calls ducts which have come from HI RES T E S T . . ALL O K " ap breviated to the first two letters
himself — along with Ellen the Nick Lambert's fertile mind. pears. The hi-res board's so MOVE X Y DRAW A B
post-person, and Steinar Lund display is on a 2 5 6 by 1 9 2 SCROLL comes out as MO X Y
who does the zappy artwork for matrix. Any particular point DR A B SC.
the cassette covers." Quicksilva — may be white or black, and can
And now what's around the The products be referenced by its X and Y co-
The software
corner for Quicksitva? The col- ordinates.
our board seems certain to be a The High The effects generated by the QS Defender occupies around
winner. Quicksilva has also Resolution board are fantastic. W e had 3K of machine code, and uses a
recently developed an interface
to allow the Acorn Atom to run
Graphics Board some samples running in the ZX
Computing offices when Nick
34 line display file which ex-
tends from the top to the bot-
a ZX printer, and they're work- The hi-res board comes with its brought the stuff in to show us, tom of the television screen. Up
ing on one for the VIC 2 0 . own test program in ROM and my office became very to 8 4 fast-moving characters
ZX C O M P U T I N G S U M M E R 1982 75
Hardware support
are on screen at a time. the board can be used with ex- than just the printer and a RAM Quicksilva are at 9 5 Upper
Although this is not the best- isting software. A lower-case pack onto the Z X 8 1 . The QS Brownhill Road, M a y b u s h ,
looking Defender for the Z X 8 1 alphabet is provided as part of Motherboard at £ 1 2 represents Southampton, Hants.
on t h e m a r k e t , it plays the character generator demon- a very cheap and useful addi-
remarkably well, and is greatly stration. tion to your system. The
enhanced when the sound motherboard is fitted with its
Part of the impressive range
board is connected. The OS Motherboard own 5 V regulator to drive all
external boards. There are two of hardware support provided
QS Asteroids, which needs
a Z X 8 1 or New ROM Z X 8 0 Some kind of motherboard is re- expansion sockets on the by Nick Lambert's company,
with the SLOW modification, is quired if you want to hook more motherboard. Quicksilva.
a pretty good version of the ar-
cade game, despite the odd-
looking asteroids. Quicksilva M M
had 'intelligent' asteroids
which homed in on your ship in
an early version but discovered
that such a game was impossi-
ble to defeat, so the program
you'll get now is a faithful copy
/
wmi
of the arcade game,
QS Invaders is the biggest of
Quicksilva's games, with a full
7K of machine code (plus a little
BASIC). There are seven rows
of 13 invaders. To see this pro-
gram running w i t h user-
programmed invaders on the
character board, with sound, is
to imagine you're watching a
proper arcade machine in ac-
tion, despite the lack of colour.
A number of manufacturers
have produced invader pro-
grams. This one, without the
sound and user-programmed
characters, is pretty much par
for the course.
Character
Generator
This is a single circuit board
which plugs directly into the QS
Motherboard, or via the QS
connector directly into the
computer. There are 1 2 8 fully
programmable characters, and
76 ZX C O M P U T I N G S U M M E R 1982
1K ZX81 Programs
Make
the
most
of IK
Chopper Squad
R Morland and M Frobisher of
Chalfont St Giles sent us this
great little program for a 1K
Z X 8 1 . You are in charge of a
cleverly-drawn helicopter. The
" 6 " and " 1 " keys move your
chopper up and down, while
the " F " key fires.
Your helicopter flies in from
the left of the screen, buffeted
by random crosswinds, and air
pockets. You use the " 6 " and
" 7 " to keep your craft in flight,
and from time to time, press
" F " to obliterate an asterisk or
two underneath you. Due to
lack of space, the program is
not perfect, as the helicopter
from time to time leaves an
'image' of itself behind if it
lands on the base, then takes
off again. You may well want to
work on this problem. The
variable S is your score.
1 10 I F I N K E V $ = " F " T H E M G O T O 23 0
* * * * * * * * * * * * * * * * * * * * * 120 PRINT RT H-X,B;"--»--"
130 P R I N T R T H^B;'*""*®"
140 IP H > = 1 4 O R H <S T H E N G O T O
30
150 P R I N T R T H - X , B; "
1 0 LET X =I 1 6 0 PRINT RT H,B;"
2 0 L E T H = LL? 1 7 0 I F 8 = 2 5 T H E N L E T 6 =X
30 L E T S =X — X 1 8 0 IF R N D > . 6 THEN LET H=H*X
40 LET B=X 190 L E T B=0-T-X
50 FOR R=5 T O 25 200 LET R=R + X
60 PRINT BT IS/P;"®" 210 IF R > 7 0 T H E N G O T O 2 6 0
70 P R I N T R T 14- , « > " * " 220 GOTO 100
3 0 NEXT R 230 P R I N T R T 14-,B," "
90 LET R =X-X 240 L E T 5 = S 4 X
100 L E T H = H * T I N K E V $ = **6" - » INKEV 250 GOTO 100
$ = "7 " J 260 PRINT S
KAYDE Elecr
80/1
FULL SIZE KEYBOARDS
WITH REPEAT KEY
comes fully assembled, tested
and guaranteed
foe vat
It comes complete with its own luxury case, (but for those of you with a tight budget this can
be purchased separately at a later date). The keytops are finger shape moulded and are in a
pleasant tone of grey with the repeat key in red, of course all the characters associated with the
ZX keyboard are printed in two colours on the keytops as per your ZX80/1.
The case is moulded in sturdy black plastic and has been designed to complement your ZX81.
The KAYDE PROFESSIONAL KEYBOARD comes at a realistic price and is second to none.
All products inc. V A T are fully built and tested and come complete
with money back guarantee.
78
onic S y s t e m s ^ /
80/1
RAMPACK
MASSIVE ADD
ON MEMORY
FULLY CASED
comes fully assembled, tested
and guaranteed
The 16K Rampack plugs straight into the user port at the rear of your computer. And of course
as in all our products the Rampack is fully enclosed in a matt black slimline plastic case.
This means you can handle it with complete safety and you do not have to stare at ugly
components - as in other makes of 16K. The Rampack NEEDS NO EXTRA POWER and will
operate quite happily on your Sinclair power supply.
Don't forget you can always order on the telephone with your credit card.
Dept ZXC1
PLEASESEND ME UNCASED KEYBOARD/S£27.96 « c h
PLEASESEND M E KEYBOARD CASE/S £10 96 each
SYSTEMS NAME
ADDRESS.
....
DRAUGHTS
43 PRINT 30 ";CHR$ (A(31));" ";CHR$
(A (30));" ";CHR$(A(29)) ;
" ";CHR$(A(28));"0"
This is a full game of draughts for the 4K Z X 8 0 . A complete
board is shown. You are at the bottom of the screen playing up,
and the Z X 8 0 is playing down. You enter each move as a
L E T T E R N U M B E R , then N E W L I N E , of the square you're
44 PRINT ." 4 0";CHR$(A(27));" ";CHR$
moving from, then L E T T E R N U M B E R , then N E W L I N E , of the (A(26));" ";CHR$(A(25));" ";CHR$
square you're moving to. You'll understand this easily once you
see the display. You'll find the Z X 8 0 plays like a reasonable (A (24));" 0"
beginner. Once you've played with it for a while, you might
enjoy trying to improve its standard of play.
45 PRINT ," 5 0 ";CHR$(A(22));" "CHRf
(A (21));" ";CHR$(A(20));" ";CHR$
Although the computer has no strategy as such {other than
look for a capture, and if it can't make one, look for a legal (A (19) ) ; " 0"
move) you'll find it plays as though it had a real method of
46 PRINT ," 6 0";CHR$(A (18)) ;" ";CHR$
looking ahead at the game and where it is developing. Kings
are made automatically. (A(17));" ";CHR$(A(16));" ";CHR$
(A (15));" 0"
80 ZX C O M P U T I N G S U M M E R 1982
ZX80 Games
51 IF A(2) «* 188 THEN LET A (Z) • — 2
52 IF A (Z) SS 180 THEN LET A ( Z ) 3 - 1
53 IF A (Z) SS 128 THEN LET A(Z) 0
54 IF A(Z) =Z 189 THEN LET A (Z) 1
1
55 IF A (Z) m 186 THEN LET A (Z ) = 2
LIST
56 NEXT Z
D
(JB
58 IF SI = 12 THEN PRINT "I WIN"
59 IF SM = 12 THEN PRINT "YOU WIN 1»
60 IF SM = 12 OR SI = 12 THEN STOP
90 IF W = 1 THEN LET C ~ D
95 IF W 2 THEN LET B - D
100 NEXT W
103 IF A BS (C - B) 10 OR ABS (C - B) »
8 THEN LET SM « SM + 1
142 IF B - C = 10 THEN LET A(B - 5) - 0
68 PRINT "LAST TO ";F$;' FROM? (LET 146 IF B - C = 8 THEN LET A ( B - 4) - 0
SUM. 147 IF C - B - 10 THEN LET A(C - 5) - 0
69 INPUT C$ 148 IF C - B « 8 THEN LET A(C - 4) « 0
70 PRINT C$;" TO?
mm
1 50 LET A(B) = A(C) STOP »M
71 INPUT B$ 160 LET A(C) - 0
74 LET F$ = B$ 165 LET U$ » ""
79 FOR W ' 1 TO 2 CUEAP CLS
77 IF W * 1 THEN LET D$ - C$
78 IF W = 2 THEN LET D0 » B$
81 ZX C O M P U T I N G S U M M E R 1982
ZX80 Games
170 IF ABS(C - B) - 10 OR ABS(C ~B)
rn 3 THEN PRINT "MULTI-JVMP?"
180 IF ABS(C - B) = 10 OR ABS(C - B)*
8 THEN INPUT U$
1990 CLS
1995 IF U$ > "" THEN GOTO 2
2000 FOR Z • 6 TO 40
200 5 IF Z < 9 THEN GOTO 2015
2010 IF A (Z) < 0 AND (A(Z - 4) " 1
OR A (Z - 4) - 2) AND A(Z - 8)
- 0 THEN GOTO 4090
2012 IF Z < 11 THEN GOTO 2015
• •
" 1 THEN GOTO 4010
4045 IF K - 0 AND KK < 350 THEN GOTO 4010
4050 IF K " 0 THEN LET SM « 12
4051 IF K - 0 THEN GOTO 2
4072 LET A(Z - (3 + K))- A(Z) TO
82 ZX C O M P U T I N G S U M M E R 1982
ZX80 Games
4110 IF (A(Z - 13) = 1 OR A(2 - 13) =
2 ) AND A(2 - 18) = 0 THEN LET
P - 1
4115 IF (A (Z - 12) - 1 OR A(Z - 12) *
2) AND A(Z - 18) - 0 THEN LET P
- 2
AfZ - 8)
4130 IF P = 1 THEN LET A (Z - 13) - 0
4140 IF P =< 2 THEN LET A(Z - 16) -
Afz - a;
4290 GOTO 2
4300 LET A(Z + 8) = - 2
4310 LET A(Z + 4) » 0
4320 LET A(Z) = 0
4330 LET SI " SI + 1
4170 GOTO 2
4200 LET A(Z - 10) « A(Z) A (Z + 3) " 2) AND A(Z - 2) - 0
420 5 LET A(Z) = 0 THEN LET P = 1
4210 LET A(Z - 5) ' 0
4350 IF Z < 23 AND (A(Z + 14) - 1 OR
4212 LET SI » ST + 1
A(Z + 14) - 2) AND A(Z + 16) -
4215 IF Z < 2 5 THEN GOTO 2
0 THEN LET P - 2
4220 IF (A ( Z - 15) - 1 OR A(Z - 15)
4360 IF Z < 23 AND (A(Z + 13) - 1 OR
= 2) AND A (Z - 20) = 0 THEN LET
A(Z + 13) = 2) AND A (Z + 18) =
P - 1
0 THEN LET P « 3
4230 IF(A (Z - 14) = J OR A(Z - 14)
= 2) AND A(Z - 18) - 0 THEN
LET P - 2
4240 IF P " 1 THEN LET A(Z - 15) = 0
ZX C O M P U T I N G S U M M E R 1382
83
r 4 36 5
4367
IF P 1 THEN
IF P m 1 THEN
LET A (Z
LET A (Z
+
-
3) -
2) - - 2
0
ZX80 Games
9080 LET A (2 3) - 9
9095 LET V$ -
9100 LET P " 0
9110 LET F$
9120 RANDOMISE
91 30 LET SI = 0
9140 L£T SW = 0
84 ZX C O M P U T I N G S U M M E R 1982
ZX81 HARDWARE
40 KEY KEYBOARD. Kit £20.50 Built £25.75 (RE77)
* Proper typewriter style keys.
* All legends and graphics in two colours.
* No soldering required to ZX81. Plugs in. (RAM/Printer not affected)
* Complete with all parts, connectors, feet and comprehensive instructions.
BOOKS £f TAPES
Getting acquainted with ZX81. £4.95
Mastering machine code. £5.95
Programming for real applications. £6.95
Tape for real applications books. £11.44
All produces available ex stock (allow 7 days extra for built products.
86 ZX C O M P U T I N G S U M M E R 1982
Business
4090
5000
GOTO 9 1 0 0
GOSUB 9 5 0 0
Software review
5010 IF F = 1 THEN RETURN
5020 LET A${G) = *' [ 8 0 x Z ] " we take a look at one of the leaders in
5030 GOSUB9100 the ZX81 business software field —
5040
5050
LET C = C - 1
RETURN Hilderbay Ltd.
6000 LET H = 0 Hilderbay produce a number of
6010 FOR D = 1 T O C splendid software packs for the ZX81,
6020
6030
IF AID) > 0 THEN GOSUB 9 7 0 0
IF A { D ) > 0 THEN LPRINT, A(D),,,, including STOCK CONTROL and PAYROLL,
6040 NEXT D and their follow-up service and
6050 RETURN documentation is an object lesson in
7000
7010
GOSUB 9 5 0 0
IF F = 1 THEN RETURN how professional software should be
7020 LET H = 0 presented.
7030 LET D = G
7040 GOTO 9 7 0 0 Hilderbay produce a number of one another and must in some
8000 PRINT "SET TAPE TO RECORD A N D PLAY" splendid software packs for the cases be performed in a certain
8010 PRINT "THEN PRESS NEWLINE" Z X 8 1 , including STOCK CON- order. Michael Levy, head of
8020 INPUT B$ TROL and PAYROLL, and their the American firm Mindware,
8030 SAVE " C U S T O M E R " follow-up service and docu- which is concentrating on pro-
8040 GOTO 2 4 0 mentation is an object lesson in viding business applications
9000 PRINT " H A V E YOU SAVED THE PROGRAM O N " how professional s o f t w a r e software for the Z X 8 1 in the
9010 PRINT "TAPE?" should be presented. US, said that the CPA program
9020 INPUT B$ All programs come complete from Hilderbay was one of the
with an extensive instruction best he had seen for any system
9030 IF B$(1) = " N " THEN RETURN
booklet. Hilderbay also offer a — and he added that he'd seen
9040 NEW
backup service, and will replace a large number running on a
9099 REM BUBBLESORT
programs made obsolete by wide variety of machines, from
9100 LET J = 0
legislation changes. We'll look IBM mainframes d o w n to
9110 FOR D = 1 T O C - 1
at their range program by pro- pocket computers. This pro-
9120 IF A $ ( D X A $ ( D + 1) THEN GOTO 9 2 0 0
gram: gram for the Z X 8 1 will deal
9130 LET K$ = A$(DI
with problems including up to
9140 LET K = AID) Financial Pack 1: This pack has 5 0 0 activities in 16K. If you
9150 LET A$(D) = A $ ( D + 1 ) three programs, LOAN, which buy one of the larger memory
9160 LET A $ ( D | = * A ( D + 1 > — for a loan repayable in equal units available, you can easily
9170 LET A $ ( D + 1) = K$ instalments — computes one of deal with many thousands of
9180 LET AID + 11 = K the following in terms of the activities.
9190 LET J = 1 Other three, principal, number
9200 NEXT D of payments, instalment and in- Payroll: This program which,
9210 IF J = 0 THEN RETURN terest; VAT, which works out, like all the others, is supported
9220 GOTO 9 1 0 0 and displays neat tables and by clear and useful documenta-
9499 REM NAME OR NUMBER running totals, as you enter in- tion and comes with a follow-
9500 LET F = 0 formation from a mixture of up service, allows employers to
9510 PRINT " N A M E OR NUMBER (1 or 2)?" bills with and without V A T at keep and update pay records
9520 INPUTJ different rate; and MORT- for up to 3 0 employees. The
9530 IF J = 2 THEN GOTO 9 6 3 0 GAGE, which can be used to basis can be weekly, monthly,
9540 PRINT " W H A T NAME?" get answers to such questions or any other time interval you
9550 INPUT B$ as " H o w much longer will your choose. Mike Salem, head of
9560 FOR K = 1 TO C mortgage take to repay if you Hilderbay, has rightly conclud-
9570 IF A$(K) (TO LEN(B$)| = B$ THEN GOTO 9 6 6 0 pay £ 2 5 less per month?" and ed that many people who use
9580 NEXT K " H o w much of your latest pay- the Z X 8 1 in their businesses
ment went towards interest?" may have no knowledge of, and
9590 PRINT " N A M E NOT F O U N D "
Budget: This program keeps little interest in, computers as
9600 LET F = 1
track of expenses for up to 5 0 such, but still want to be able to
9610 PAUSE 1 0 0
headings over a year. For each use the programs without trou-
9620 RETURN
heading, a budget can be ble. This program was designed
9630 PRINT " W H A T NUMBER?"
entered at any time. A second to cater for these people. You
9640 INPUT G
version of the program is can, if you like, write the results
9650 RETURN
available, which handles the in- by hand on the usual cards,
9660 LET G = K
formation in a different manner. rather than using the printer. As
9670 RETURN
Both versions have a facility to well, you can always revert to
9699 REM PRINT A CUSTOMER doing it all by hand if you like
9700 LET X = 0 trigger the printer for a perma-
nent record. Both versions can You won't become dependent
9710 IF H = 1 THEN LPRINT D; on the computer.
9720 LPRINT TABI5); be used for private or business
9730 LET X = X + 1 purposes. V A T is not included The program is designed to
9740 IF A${D,X) = THEN GOTO 9 7 8 0 explicitly, but can be handled if be saved after each use, thus
9750 IF A${D,X) = THEN GOTO 9 8 1 0 required as one or more saving the current variables on
9760 LPRINT A$(D,X); separate headings. tape, then run next time with
9770 GOTO 9 7 3 0 the command GOTO 1, rather
9780 LPRINT Critical Path Analysis: This pro- than RUN. The current program
9790 LPRINT TABI5); gram allows the user to apply being sold by Hilderbay is, so to
9800 GOTO 9 7 3 0 the critical path analysis tech- speak, obsolete, because of tax
9810 LPRINT nique to any projects which and other changes, but those
9820 LPRINT consist of a well-defined set of having earlier versions wilt be
9830 LPRINT activities which may be started supplied with up to date ver-
9840 RETURN and stopped independently of sions. This fact shows the at-
ZX C O M P U T I N G S U M M E R 1982 87
Business
tention Mike Salem has paid to
ensuring that he provides a pro-
per software service, rather
than just running a "post the
cassette and run" operation.
Ail payroll programs, and not
just ones sold by Hilderbay, will
become obsolete in 1 9 8 3 / 8 4
due to legislative changes
which were due to come into ef-
fect in 1 9 8 2 / 8 3 but were post-
poned. The rules themselves e - TC>
N . I .
- MIKf JALffl T ? S I CODES
will then change, not just the S NO ML
numbers. Until then, however,
STANDARD, NOT C O N T R A C T E D OUT
you can work out your payroll SELECT ONE O F
REDUCED RATE, NOT C.O.
requirements without pro- 3 SRUE R E S U L T 3 ON T A P E . OUER P E N S I O N AGE
1
• DO A N E M P L O Y E E S PAY.
blems, knowing that if — in the 3 SUMMARY ALL. EMPLOYEES. s t a n d a r d , c o n t r a c t e d OUT
meantime — t h e numbers REDUCED PATE, C . O .
change again, Hitderbay will 2 S E TMONTH/UEBK NUMBER.
change your program for you. ENTER NEU CODE N.l.
ZX C O M P U T I N G S U M M E R 1982
I 1K Games
UFO
This game UFO, written by S
Hassen of Worthing, was writ-
ten to show just how much can
be squeezed into 1K without
resorting to machine code. Mr
Hassen tells us he has used
every trick he knows to get the
program into 1K. The object of
the game is to shoot down the
saucer hovering near the top of
the screen. As you probably ex-
pect, the " 5 " will move you left
while the " 8 " moves you right.
Press " 0 " to fire. As you'll see
when you run the program, the
saucer does not sit still, but
moves back and forth, calling
for all your aiming skill. When
struck (by a little full stop which
zaps up to the saucerl it blows
apart, and your score is shown.
The lower the score, the better.
Any score over 7 2 is lousy. Any
score less than 10, I don't
believe you. The game ends
once you've hit the saucer, and
waits until you press any key to
start again. The PAUSE 4E4
(developed by Trevor Toms,
author of THE Z X 8 1 POCKET
BOOK) is remembered by think-
ing of it as 'pause forever'. It
obligingly waits, more or less,
forever for you to press a key to
get things underway again. If
you have trouble seeing the full
stop as it slowly zaps towards
the target, replace it with a
graphic A.
10 LET X = U R L
20 LET Q -NOT
3 0 L E T 0=Q
4-0 L E T F = Q
50 LET B=X
60 LET Y=X
70 LET Z = 5 G N X+SGN X
3 0 LET K = I N T ( R N D + R N O )
L E T B = B + f K R N O X+X.V - T N O T K
A N D B)
100 LET TINKEY$=" R N O Y <X
+ X ) - ( I N K E V $ = " 5 " R N O Y.I
110 L E T D =D + Z
L E T F =F + Z
PRINT RT NOT X,B," RT
";RT X-D,Y+Z RND
X-D,Y+Z;" " RNO O
O R N D Y = B R N D N O T D-.X T H
210
160 D=X THEN LET O =NOT X
160 D =X THEN LET D=0
170 NOT INKEY$="0" THEN GOTO
80
l a o LET Q=SGN X
1 90 L E T D =NOT X
200 G O T O 3 0
210 PRINT RT N O T X / B ; ".» > # < (
220 P A U S E 4-E4-
2 3 0 C-L'5
24-0 R U N
ZX C O M P U T I N G S U M M E R 1982 89
Games
zx Drawing Board
Sample Program
T h » simple little program, quite 10 LET D = 310
apart from enabling one to draw Try the following data string,
pretty picture* on the screen of the '/* represents the N E W L I N E . A) LET C = 20
one's Z X 8 0 , shows how you can
control on-screen movement. You FOR I = 1 T.O 640
5/128/8/4/2/2/4/4/2/2/2/2/6/6/2/6/8/6/6/6/6/6/ f
can change the symbol in use and PRINT" ";
the direction in which you are 6/2/6/8/6/6/8/4/8/8/8/8/8/6/8/4/4/4/2/2/2/4/4/ £
moving st any time during the NEXT I
program execution. 4/4/4/4/8/8/8/5/8/9/9/9/9. qq POKE PEEKH6396) +
Instructions and Variables 256'PEEK( 16397) + D,C
When the program is R U N an 70 INPUT A
asterisk (star) it displayed on the
screen. To alter the symbol in use
80 IF A = 1 THEN LET D = D + 32l
press '5' then ' N E W L I N E ' followed 90 IF A = 2 THEN LET D = D + 3S
by the code of the required symbol
and ' N E W L I N E ' . Changes in the 100 IF A = 3 THEN LET D = D + 34
direction of movement can be made
by keying the desired direction
110 IF A = 4 THEN LET D = D - 1 I
code ( see Fig. 1.) and the inevitable 120 IF A = 6 THEN LET D = D + 1
'NEWLINE'
The program uses the following 130 IF A = 7 THEN LET D = D - 3 i f
variables: 140 IF A = 8 THEN LET D = D - 3 3 |
D - Position on-screen of current 150 IF A = 9 THEN LET D = D - 3 2 1
symbol.
C Code of displayed symbol. 4 + 6 160 IF A = 5 THEN INPUT C
A Direction code. 170 GOTO 60
I Dummy variable.
1 REM "5KETCHPPD
5 FR5T
6 FOR N =0 T O 6 3
7 P L O T N., 4-3
8 PLOT N,O
9 NEXT N
10 F O R P = 0 T O 4-3
11 PLOT 0.P
12 PLOT 63,P
13 NEXT P
15 5LOU
20 LET X = 32
30 LET Y = 22
40 GOSUB 500
50 UNPLOT X,Y
60 P L O T X JY
70 G O T O 4-0
80 GOSUB 500
90 GOTO 80 H.H.H.1982
100 GOSUB 500
110 PLOT X,Y
120 UNPLOT X,Y
130 GOTO 100
500 IF I N K E Y * = «« ^ M GOTO 40
510 I F I N K E Y $ = ** 2 " GOTO
520 IF INKEY%= GOTO 600 50 FOR N=0 TO 100©
530 IF INKEY$="0" THEN GOTO 100 M T * J = W T
tRND*22) +10
540 IF I N K E Y $ = " 5 " T H E N LET X =X — 70 LET Y=INT IRND*22)
8 0 I F X + Y <24- T H E N G O T O 5 5
550 IF INKEY$="6" THEN LET Y=Y- 90 PLOT X,Y
1 0 0 P L O T X , 4-3 — Y
560 IF I N K E Y % - *A M THEN LET Y =Y + 1 1 0 P L O T 6 3 — X , 4-3 — Y
120 PLOT S3-X,Y
570 IF INKEY "Q" THEN LET X=X + 130«NEXT N
590 RETURN
• M
90 Z X C O M P U T I N G S U M M E R 1962
Etchasketch
This very short program allows and modify it to (a) give you a
you to use the keys " 5 " , " 6 " , choice of starting position;
" 7 " and " 8 " to move the PLOT and/or (b> 'turn off' the blob
blob around the screen, draw- from time to time tomove it to a
ing pictures of your choice. new position on the screen
Once you've got it running, try without leaving a trail.
Keep this handy reference guide t o aid you when programming your ZX81
O
Symbol Code How obtained Symbol Code How obtained
R=5H
0 • or • •••••••• 8 0 133 0
H
SPACE shifted 8
m
shifted A
1 0
0
m
shifted 1 134 0
shifted Y
2 0 10
shifted D
shifted 2 135 0
0
shifted 3
3 0 128
shifted S
shifted 7
136 0
0 shifted H
4 0 129
shifted 4
SPACE
137 0
5 0 130 shifted G
0
shifted 5
6 0 131
shifted Q 138 0
shifted F
shifted T
0
7 0 132
shifted W
shifted E
0 91
shifted 6
0
shifted R
Review
ZX C O M P U T I N G S U M M E R 1982
Review
ZX C O M P U T I N G S U M M E R 1982 93
Review
and use the remainder of the hand, you regularly use a
instruction manual as typewriter keyboard, you will
reference as and when take a few hours to adapt to
needed. The main bulk of the the diminutive size of the
book is for the novice, Z X 8 1 : but then those few
explaining clearly and hours will enable you to
concisely all the statements become accustomed to the
and commands. Most of the fact that some keys may give
chapters are essentially a up to six different results! One
'hands-on' teaching very small but important
programme in 2 X 8 1 BASIC, improvement on the Z X 8 1 is
with a number of useful its rubber feet. The Z X 8 0 and
exercises to extend the Z X 8 1 are both very light in
knowledge gained in the weight, and with its new feet
preceding text. Chapters 2 6 , at least the Z X 8 1 does not
2 7 and 2 8 introduce the idea skate all over the table as you
of machine code, the use it I
organisation of the memory,
and explain what the system All in all, I can recommend
variable are and where they the Z X 8 1 to any intending
are stored. purchaser — it is very good
value for money. It does not
Appendix A lists the have the facilities one would
character set, Appendix B
require for a business machine
gives the Report (Error) codes
but anyone wanting to learn
and Appendix C give a short
personally what a computer
r6sum6 of the Z X 8 1 and its
can do, without initially
individual characteristics
under the heading: "The Z X 8 1 spending a fair amount of
for those that understand money, should seriously
does not have these and
BASIC". The Index is useful consider one. After all, the
commands, the manual "ABCDEF"(3) = " C "
and comprehensive, giving not Z X 8 1 does not cost much
explains the use of simple
only page references but also more than the cassette
routines to obtain access to Different as this may be from
the key sequences required for the first four effectively. The recorder that you will need to
other common micros it is
all keywords and shifted latter four deal with string buy for some makes of micro.
easily understood and will
characters. manipulation, and whereas the readily yield the results you The only personal
Those who already have Z X 8 1 does not have these would expect from the more drawback to the whole Sinclair
some knowledge of BASIC will specific commands the way in usual string commands. ZX episode is that my seven-
note from the which it deals with strings is year-old son tends to look
command/statement list that comprehensive, albeit non- upon the Z X 8 0 and the Z X 8 1
there are a few common standard. It uses a notation
called 'slicing' for describing
using it as more his size! He does not
have quite the reverence for
BASIC commands that are
noticeable by their absence, substrings. This can be applied In use, the Z X 8 1 presents no the ZXs as he does for other
principally DATA, READ, to arbitrary string expressions real lasting problem to micros of the desktop variety.
RESTORE, ON-GOTO, LEFT$, and takes the general operate. If you are new to Demand for its use seems to
MID $, RIGHT $ and TL$. form . . .'string expression using a computer then you be unending and we often
These are listed in the index (start TO finish)' so that have probably used a hear "Press NEWLINE, silly!"
but not in the bold type, calculator and so the keyboard as he instructs his five-year-
indicating that they are Z X 8 1 "ABCDEF" (2 TO 5) spacing wilt not seem all that old sister in the uses of
keywords. Although the Z X 8 1 = "BCDE" different. If, on the other twentieth-century technology.
B H P R 183 E B H S C S
=\ . ;- -A\ *.* »•.:• t?OF
EB IB\mm
•GEl BQBE3) M^Q 01El 0 :
uB IB1
-.£.. A.-: v K ^ o O * ^ ^ jOSUB ^AC ^ ^
K3Ea Mi^fffli
nil hh B 0 Elj C U E H •
a \ ic; - ap~ .at ,E\ i <.:;
."-• '..i \E*T PAfSt
94 ZX C O M P U T I N G S U M M E R 1982
Review
ZX C O M P U T I N G S U M M E R 1982
HORRORVILLE
Only for the brave! Dare you take on the might of the
8K ROM in this A D V E N T U R E program for the 16K
ZX81, written in gruesome detail by N. Alexander of
Margate. Once you've survived the Alexandran horrors,
you can change lines 6000 to 6500, and 8000 to 8500
t o enter your own adventures.
96 ZX C O M P U T I N G S U M M E R 1982
16K Games
270 IF FI=2?5 T H E N GOTO 2 (9) 1630 RETURN
280 IF R =54.0 T H E N GOTO Z ( 10) 2 0 0 0 CLS
2 9 0 IF R = 3 7 1 T H E N GOTO Z t 11) 2005 PRINT "ON YOUR LEFT YOU CRf i
3 0 0 IF R = 2 3 9 T H E N GOTO Z < 12) SEE T W O "."KEYS DO YOU URNT TO
3 1 0 IF R =4-52 T H E N GOTO Z < 13) PICK ONE UP?"
3 2 0 IF fl-161 THEN GOTO 7301 2010 INFUT Y $
330 GOTO 100 20 1 2 IF Y $ = " N " T H E N C L S
1000 P R I N T RT 0 , 0 , ' R D U 2 0 1 5 IF Y $ = " N " T H E N G O T O 100
E N T U R E"
1010 PRINT
2020 PR I N T U H I C H K E Y D O Y O U URN
T . 1 OR 2 ? "
1012 PRINT 3TRRT 2025 INPUT Y
END " 2 0 3 0 LET R $ = "KEY ONE
1014 P R I N T 2 0 3 5 IF Y = 2 T H E N L E T P l = " K E Y TUC
204-0 C L S
1020 PRINT 2 0 4 5 P R I N T ' R E M E M B E R Y O U R R E NO!,
CRRRYIMG"
130 PRINT 2050 FOR 1=1 TO 50
2055 NEXT I
2060 C L S
2065 GOTO 100
2500 CL3
2 5 0 5 P R I N T "ON R I G H T IS R P
L R N K OF W O O D " . DO YOU URNT TO C
RRRY IT° "
2510 INPUT Y $
2 5 15 IF Y $ = " N " T H E N C L S
2 5 2 0 IF Y J = " N " T H E N G O T O 100
2525 LET P$="UOOD"
2530 CLS
2 5 3 5 PR I N T R E M E M B E R Y O U R R E CR»
RYING R$
254.0 F O R 1 = 1 T O 5 0
2545 NEXT I
2550 CLS
2555 GOTO 100
3 0 0 0 CLS
3 0 0 5 P R I N T " R T Y O U R F E E T IS R D 1
R M O N D ,"NECKLACE DO YOU U R N T T O
P ICK" /'IT UP"
3 0 10 I N P U T Y $
3 0 1 5 IF Y $ = " N " T H E N C L S
3 0 2 0 IF Y $ = " N " T H E N G O T O 100
3025 PRINT "DONT FORGET:- YOU HP
1155 LET P=PEEK (16396)+256*PEEK U E P I C K E D ' "UP R N E C K L R C E "
T16397) 3030 LET R $ = " N E C K L R C E "
1160 POKE P T R . 1 6 0 3035 FOR 1=1 T O 50
1165 RETURN 304.0 N E X T I
1500 GOSUB 9 G 5 0 3045 CLS
1 5 0 5 P R I N T *' Y O U R R E CFIPT I U E IN 3050 GOTO 100
R GIANTS" 3500 CLS
1510 GOSUB 9 0 5 0 3 5 0 5 P R I N T "DO Y O U U R N T T O PICK
1515 PRINT "CRSTLE R N D T H E ONLY U P fi P I E C E " . " O F R O P E ? "
WRY Y O U C R N " 3510 INPUT Y $
1520 G O S U B 9 0 5 0 3 5 1 5 IF Y * « " N " T H E N C L S
1 5 2 5 P R I N T " E 5 C R P E IS T O T R R U E L 3 5 2 0 IF Y $ = " N " T H E N G O T O 1 0 0
THROUGH " 3 5 2 5 P R I N T "THE R O P E IS Y O U R S . "
1530 GOSUB 9 0 5 0 3530 LET R $ = " R O P E "
1 5 3 5 P R I N T "R N E T W O R K O F U N D E R G R 3 5 3 5 FOR 1 = 1 TO 3©
OUND CRUE5" 3540 NEXT I
154-0 G O S U B 9 0 5 0 3545 CLS
1545 P R I N T "BUT B E U R R E " 3 5 5 0 G O T O 10©
1550 G O S U B 9 0 5 0 4000 CLS
1555 G O S U B 9 0 5 0 4 0 1 0 PRINT "YOU H R U E TO C L I M B UP
1560 P R I N T "YOU UILL C O M E UP R G R R 3 M R L L " , " C L I F F . HR'JE Y O U G O T R
INST " ROPE?"
1565 G O S U B 9 0 5 0 40L« INPUT Y $
4 U A A IF Y $ = "Y ' R N D R $ = " R O P E " T H E
1570 PRINT "PERILS RND D E C I S I O N S N O O T O 4.200
1575 GOSUB 9 0 5 0 4 0 2 1 IF Y $ = " N " T H E N G O T O 4 0 2 3
4»fi& P R I N T " O H N O Y O U H R U E N T "
1580 PRINT "YOU MRY BE O F F E R E D U 4030 PRINT "THEN YOU MUST BORROW
*RIOUS" O N E O F " , " O U R S O N E IS S R F E R N D
1585 GOSUB 9 0 5 0 O N E IS N O T ' " C H O O S E Y O U R R O P E : - 1
1590 PRINT "OBJECTS BUT Y O U MRY OR 2 "
ONLY CRRRY" 4032 LET H$ ="2"
1595 G O S U B 9 0 5 0 4 0 3 5 IF R N D < .5 T H E N L E T H $ = " l "
1600 PRINT "ONE RT R T I M E R N D M U 4 0 4 0 I N P U T 1$
ST D E C I D E " 4 0 4 5 IF I $ = H $ T H E N G O T O 4 2 0 0
1605 G O S U B 9 0 5 0 4050 PRINT "YOU CHOSE URONG SPLR
T"
1610 P R I N T " U H I C H UILL BE M O S T U 4055 GOTO 9800
SEFUL" 4 206 PRINT "OK.YOU MRY CONTINUE
1615 GOSUS 9050 4 203 FOR 1=1 T O 50
1620 PRINT " R E R D Y ° PRESS RNY f 1210 NEXT I
EY T O S T R R T "
1625 PRUSE 9999
ZX C O M P U T I N G S U M M E R 1982 97
16K Games
4215 CL5 5930 CLS
4220 GOTO 100 594.0 G O T O 1 0 0
4500 CL5 6500 CLS
4 5 05 PRINT "YOU M U S T MEET THE OG 6505 LET T $="TOILET ROLL"
RE" . "HRUE Y O U R G I F T FOR H I M ? " 6 5 1 0 IF R N D < .3 T H E N LET T$ = "SHOE
4 510 INPUT Y$
4 5 1 5 IF V $ = " N *' T H E N G O T O 4 7 0 0
4 5 2 0 IF R N D < . 8 T H E N G O T O 4 S 0 0
4530 PRINT "SORRY THE OGRE DOES 6 5 2 0 IF R N D > . 6 T H E N LET T $= "DERD
NOT L I K E " , R $ FISH"
4 5 3 5 FOR 1=1 T O 90 6 5 3 0 PRINT "RHR Y O U SRY I CRN ",
4540 PRINT "RIP "; " S E E R " .T $
4 545 NEXT I 6540 PRINT "BUT UILL YOU PICK IT
4550 GOTO 9800 UP'*"
4 7 0 0 P R I N T " T H E N BE ON Y O U R U R Y 5550 INPUT Y $
R N D D O H O T " . " T R Y T O C O M E T H I S Ufi 6 5 6 0 IF Y $ = " N " T H E N CLS
V RGRIN" 6 5 7 0 IF Y $ = " N " T H E N GOTO 100
"•SQ0 L E T R « = T S
4705 LET R=R-B
4710 CLS
4715 GOTO 100
4 8 0 0 IF R $ = " 0 " T H E N G O T O 4-530 5590 PRINT "NOU YOU HRUE YOUR UE
4 8 0 5 P R I N T "OK H E L I K E D T H E " ; R $ RY O U N " ; T $
480© FOR 1=1 T O 5 0 5600 FOR 1=1 T O 50
4807 NEXT I 6610 CLS
4810 CLS 6620 GOTO 100
4815 GOTO 100 7000 CLS
5000 CLS 7010 PRINT "YOU R R E C R R R Y I N G ",R
5005 PAUSE (RND*J.0> $;" SO DO Y O U " t " U R N T T O PICK UP
5010 PRINT "YOU HPUE COME T O T H R SOME URCCINE", INSTEAD?"
EE D O O R S " . " C H O O S E Y O U R DOOR,1.,2 7020 INPUT Y $
OR 3" 7 0 3 0 IF Y $ = " Y " T H E N L E T R $ s " U f i C C
INE "
7040 CLS
7 0 5 0 G O T O 100
5020 INPUT Y 7490 GOTO 850O
5030 LET X=RND*4 7 5 0 0 G O T O 8S00
5040 FOR 1=1 T O 3 750 1 CLS
5050 LET X =X + 1 7 5 1 0 F O R 1 = 1 T O 4-2
5050 IF X > 3 T H E N L E T X = 1 7520 PRINT "COMGRflTULRTIONS'
5070 GOSUB 5060+(1+10) 7530 NEXT I
5075 NEXT I 754 0 G O T O 9 9 5 0
5076 LET R=H(Y)
5079 CLS
5080 G O T O 100 5b00 CLS
5090 LET H ( X ) = I 3 S 8 5 0 5 PR I N " Y O U HR'JE C O M E R C R O S 5
5095 RETURN R PLRGUE " . " O F RRTS"
5100 LET H(X)=291 8 5 1 0 IF R » = " U R C C I N E " T H E N P R I N T
5105 RETURN "BUT LUCKILY Y O U CRN USE Y O U R " , "
5110 LET H(X)=519 U R C C I N E .YOU M R Y C O N T I N U E "
5115 RETURN 8 5 2 0 IF R $ i " U R C C I N E " T H E N G O T O 6
5500 CLS 300
5510 P R I N T "RHEfiD I S R D O O R IN F 8 5 3 0 IF R N D < . 2 T H E N G O T O 3 6 0 0
RONT O F " , " U H I C H IS R L R R G E 5LEE 6 5 4 0 P R I N T " Y O U H R U E N O I'RCCINE
PING GIRNT" . "H.qUE Y O U GOT R KEY7 RUN QUICKLY"
354-5 L E T ft=ft-6
8550 GOTO B3O0
86O0 PRINT "THE RRTS SIT YOU AND
5520 INPUT Y $ HRUE"."NO URCCINE SORRY"
S 5 3 0 IF Y $ = " N " T H E N G O T O 5 9 0 0 6610 GOTO 9950
554-0 IF R $ = " K E Y O N E " O R R £ = " K E Y 6 9 0 0 FOR 1=1 T O 50
TUO" THEN GOTO 5600 ©910 NEXT I
5550 PRINT O H N O Y O U HRl'ENT" 6 9 1 5 IF R $ s " U A C C I N E " T H E N L E T R $
55B0 GOTO 5900 = "O"
S60O LET T = RND 8920 CLS
5 6 1 0 IF T < . 2 T H E N P R I N T THE GIR 8 9 3 0 G O T O 100
N T R T E Y O U 11 9 0 0 0 L E T X s R N D 1 4.
5 6 2 0 IF T < . 2 T H E N G O T O 9 9 5 0 9 0 0 2 F O R N = 2 0 0 0 TO 6 5 0 0 iTEP 5 0 0
5 6 3 0 IF T > . 7 T H E N P R I N T " S O R R Y Y 9005 LET X=Xtl
OUR KEY D ID N T F I T N O U "."THfiOU I
T RURY"
5 6 4 0 IF T > .7 T H E N L E T R $ = " O "
5 6 5 0 IF T > - 7 T H E N L E T R = R - B
5 6 6 0 IF T > . 7 T H E N G O T O 5 9 0 0 9010 IF X > 1 3 T H E N L E T X =1
5 6 7 0 P R I N T "OK Y O U R K E Y F I T S Y O U 9015 LET Z(X)-N
MRY " , " C ON T I N U E " 9020 NEXT N
9025 RETURN
9050 SCROLL
9055 FOR N=1 TO ©
5630 GOTO 5910 9060 NEXT N
5900 P R I N T "SO BE ON YOUR URY 9065 RETURN
5905 LET R=R-B 9950 P R I N T " RGRIM"* '*
5910 FOR 1=1 T O 50 9960 INPUT Y *
5920 NEXT I 9970 IF Y * = " V " T H E N R U N
98 ZX C O M P U T I N G S U M M E R 1982
Make sure you get every issue of Z X Computing.
ZX Computing Subscriptions
513 London Road,
Thornton Heath,
Surrey CR4 6AR
99 ZX C O M P U T I N G S U M M E R 1982
( M a i l Order DeptE )
99 East St, Epsom Surrey, Tel 03727 21215
quoting your credit card 24 hr phone service
* REQUIRE 16K RAM A i r IVIail Europe plus 70 p Elsewhere plus 111.7i)J
100 ZX C O M P U T I N G S U M M E R 1982
ZX80 Programs
ZX C O M P U T I N G S U M M E R 1982 101
mmm
ZX80 Programs
Battleships
A boom, boom here, and a bang, flash
there, and devastation covers the
seas, in J Calderwood's version of the
old pencil and paper game.
Here's your chance to play puter will then show where 70 LET Z(Y) = 1 0
battleships against the Z X 8 0 . your bomb landed. If you hit a 80 LET Z(Y - 1) = 1 0
The programs asks you to enter ship, it will be shown in inverse
90 LET Z(Y + 1) = 1 0
a number up to 10, and a letter otherwise it shows as an
100 NEXT X
to J. These are to be entered asterisk. You have to try and
110 INPUT A
one at a time. The clever com- land three bombs on each ship.
120 INPUT B$
5 RANDOMISE 130 LET B = CODE (B$)
10 PRINT "BATTLESHIPS" 140 LET B = ( 1 0 * ( B - 3 8 ) ) + A
20 PRINT 145 IF Z(B) = - 1 OR Z(B) = 9 THEN GOTO 1 10
21 PRINT "THERE ARE 8 SHIPS EACH 3 SQUARES LONG" 150 LET Z(B) = Z(B) - 1
22 PRINT "ENTER A NUMBER UP TO 1 0 " 155 CLS
24 PRINT " A N D A LETTER UP TO J " 160 PRINT " 1 2 3 4 5 6 7 8 9 1 0 "
30 DIM Z( 1 0 0 ) 200 FOR T = 1 TO 1 0 0
40 FOR X = 1 TO 8 210 IF Z(T) = 0 OR ZIT) = 1 0 THEN PRINT " " ;
50 LET Y = RND(99) 220 IF Z ( T ) = - 1 THEN PRINT " * " ; •
60 IF 1 0 M Y / 1 0 ) = Y OR 1 0 " ( ( Y - 1 )/10) = Y - 1 THEN 230 I F Z | T ) = 9 THEN PRINT C H R $ | 1 4 8 ) ;
GOTO 5 0 235 IF ( T / 1 0 P 1 0 = T THEN PRINT C H R $ ( 3 7 + T / 1 0 )
6 5 IF Z(Y) = 10 OR Z{Y - 1 ) = 1 0 OR Z(Y + 1) = 1 0 THEN 240 NEXT T
GOTO 5 0 250 GOTO 1 1 0
102 ZX C O M P U T I N G S U M M E R 1962
ZX80 Programs
Catch 80
90
LET Z = Z + 1
INPUT C
Avoid being trapped by your sneaky, 100
110
GOSUB 5 0 0
GOSUB 6 0 0
little ZX80. 120 POKE M , 0
130 IF C = 6 AND A < 1 0 OR C = 7 AND A > 1 THEN LET
The object of this game by position. A = A — 1*C+13
I Soutar is to avoid getting nab- If you move onto the black 140 IF C = 5 THEN LET B = B - 1
bed by the computer. You square, all hell will break loose. 150 IF C = 8 THEN LET B = B + 1
move by entering " 5 " to move Well, actually it won't, but the 160 GOSUB600
left, " 6 " to move down, " 7 " game will end, and the Z X 8 0 170 IF PEEK(M) = 1 2 8 THEN GOTO 4 0 0
to move uo or " 8 " to move will tell you how many moves 180 POKE M , 2 0
right. When you've moved, the you survived. Anything over 9 5 190 LET D = RND(4)
Z X 8 0 will place a black square is very good, and you'll be 195 IF A = 1 0 AND D = 4 OR A = 1 AND D = 3 THEN GOTO
on one of the four sides of your awarded a gold star. 190
200 LET D = (D = 1) - 1 • (D = 2) + 3 3 # < D = 3) + 3 3 ' I D - 4 )
210 GOSUB500
1 RANDOMISE 220 GOSUB600
2 LET B = 1 6 230 POKE M + D, 1 2 8
4 LET A = 6 240 GOTO 8 0
6 LET M = 0 400 CLS
8 LET P = 0 410 PRINT " Y O U LASTED FOR";Z;*'MOVES"
10 LET W = 0 499 STOP
12 LET D = 0 500 LET P = PEEK(1 6 3 9 7 1
14 LET C = 0 510 IF P > 1 2 7 THEN LET P = P - 2 5 6
20 LET Z = - 1 520 LET W = PEEKd 6 3 9 6 ) + P * 2 5 6
25 GOSUB700 530 RETURN
30 FOR I = 1 TO 9 600 LET M = W + ( A - 1 ) * 3 3 + B
40 PRINT,,,, 610 RETURN
50 NEXT I 700 FOR 1 = 1 TO 3 2
52 GOSUB 7 0 0 710 PRINT C H R $ ( 1 2 8 ) ;
60 GOSUB500 720 NEXT I
70 POKE W + 1 8 1 , 2 0 730 RETURN
Shift
190 FOR C = 0 TO 3
200 LET D = B * 4 + C
210 IF A I D X 1 0 THEN PRINT " " ;
winging across the seas from New 220
230
IF NOT A ( D ) = 16 THEN PRINT " ";A(D);
IF A(D) = 1 6 THEN P R I N T " ";CHR$(128);
Brunswick, Canada, is Joseph Ho's ZX80 240 IF AID) = 1 6 THEN LET G = D
game based on the slide games in 250 NEXT C
which tiles with the numbers one to 260
270
PRINT
PRINT
15 have to be arranged in order. 280 NEXT B
290 LET E = G / 4 + 1
When you press RUN, you'll see appears if you try to cheat. The 300 LET F = G - ( G / 4 ) * 4 + 1
a 4 x 4 grid. On it are the number you've entered, if you 310 FOR B = 0 TO 15
numbers one to 1 5, and an in- haven't cheated, and all the 320 IF A(B) = B + 1 THEN NEXT B
verse space. The numbers are numbers between it and the 325 IF B = 16 THEN GOTO 2 0 0 0
scrambled, and you have to try space will shift one place 330 PRINT
and put them in order with the towards the space and the 340 PRINT "NUMBER?"
black square in the lower right- space will appear in the place of 350 INPUT B
hand corner. The black square the number entered. Once 360 IF B < 1 OR B > 1 5 THEN GOTO 1 0 0 0
represents an empty space. you've solved the problem, the
370 FOR C = 0 TO 15
The numbers can be moved Z X 8 0 will tell you how long it
380 IF NOT A(C) = B THEN NEXT C
around by entering a number took you to do it. You'll find it
390 LET B = C / 4 + 1
that is directly above, below, fairly easy to convert this pro-
400 LET D = C - ( C / 4 ) * 4 + 1
directly to the left or to the right gram to run on a Z X 8 1 ,
410 IF NOT B = E AND NOT D = F THEN GOTO 1 0 0 0
of the space. A rather quaint although it will not fit within 1K
420 LET l = A B S ( C - G )
error message — DO OVER — as does the Z X 8 0 version.
430 IF D = F T H E N LET U I / 4
10 DIM A l l 5) 440 FOR H = 0 TO I - 1
20 FOR A = 0 TO 15 450 IF D > F THEN LET A(G + H) = A(G + H + 1)
30 LET A(A) = A + 1 460 IF D < F THEN LET A(G - H ) » A ( G - H - 1)
40 NEXT A 470 IF D > E THEN LET A(G + H * 4) = A((G + H • 4) + 4)
50 FOR A = 2 TO 15 480 IF D < E THEN LET A ( G - H * 4 ) = A((G - H * 4 ) - 4)
60 LET B = R N D | A > - 1 490 NEXTH
70 LET C = A(A) 500 LET A(C) = 1 6
80 LET A(A) = A(B) 510 NEXT A
90 LET A(8) = C 1000 PRINT " D O OVER"
100 NEXT A 1010 GOTO 3 5 0
110 FOR A = 0 TO 1 0 0 0 2000 PRINT " Y O U DID IT IN " ; A ; " M O V E S "
140 CLS 2010 CLEAR
150 PRINT" SHIFT" 2020 PRINT "TYPE Y TO PLAY A G A I N "
160 PRINT " " 2030 INPUT A$
170 FOR B = 0 TO 3 2040 IF A$ = " Y " THEN RUN
180 PRINT 2050 PRINT " HOPE YOU HAD FUN"
2X C O M P U T I N G S U M M E R 1982 103
Software
Down
If I had to choose just one pro- copy the screen to a printer to
gram to impress an audience prove to myself that these
with the capabilities of the amazing pictures were made up
Z X 8 1 , then J K Greye's " 3 - D from the standard Sinclair
in t h e
Monster M a z e " would be the character set.
one without a doubt. Written So the graphics are great,
mainly in machine code, this but how good is it as a game?
9ViK game includes graphics I'm pleased to be able to say
which had me checking that the that it is very good indeed.
program was really being run on There is on-screen scoring as
Depths
a Z X 8 1 , rather than one of the you move around, plus bonus
micros that measure their price, points if you find the exit, which
as well as their memory, in Ks. involves yet more graphics ef-
The impressive features of fects. The exit is a moving
this program start even before kaleidoscope of letters and
the game itself begins. A symbols which grows as you
c l e v e r l y - d r a w n c l o w n an- approach it. But beware of
nounces the instructions which being hypnotised by it, as Rex is
scroll up the right-hand side of always close by to wake you
the screen. The clown even up.
doffs his hat (although I must Phil Garratt takesU the plunge If you find the exit, a new
admit that at first I thought his
head had fallen off, even these
with J K Creye's 3-D Monster maze is created and your score
is carried forward. If you do
graphics have some limitations).
Any program which can liven
Maze". happen to end up in Tyranno's
tummy, you get the opportuni-
up the presentation of the in- response is instantaneous. y o u . . . or when you find the ty to start again with the same
structions has to have a lot go- There is a real sense of motion e x i t . . . so this is no game for maze, so you can build up your
ing for it. through the maze if you keep the faint-hearted. You are told if chances of escape.
The Z X 8 1 goes into FAST your finger on 'forward'. Hav- he is getting close, although if With such a professional
mode to set up the maze, and ing played a couple of very slow you're lucky (?) you'll see him standard of presentation main-
when it is complete, you are 3-D mazes written in BASIC, lumbering towards you, getting tained throughout the program,
g i v e n an e x c e l l e n t 3-D this program would have been bigger and bigger, the jaws it deserves to do very well in-
representation. All walls are streets ahead . . .if it wasn't opening wider and wider. Even deed. I certainly haven't seen
shaded and passages to the left for Rex, after playing the game many anything like it before, but I
and right can be seen clearly Rex is t h e u n f r i e n d l y times, the sight of him still hope it is just the start of
quite a way ahead. Keys 5, 7 neighbourhood dinosaur who makes me jump. Truly the stuff 'realistic' graphics games for
and 8 are used to turn left, go inhabits the maze. You only of nightmares. The graphics are the Z X 8 1 . " 3 - D Monster
forward and turn right, and the score points when he is chasing incredible and I found I had to M a z e " is E 5 . 9 5 .
SCGRSE SCORE
5.3 75
YOU
HRUE
ELUDED
J i i i f i s HIM
RND
SCORED
POINT S
SCORc
105 R E X IS
UERY
RNGRY.
YOU,LL
NEED
MORE
LUCK
THIS
TIHE .
104 ZX C O M P U T I N G S U M M E R 1982
Software
reading highly enthusiastic themselves are a mixed bag. you have the option to fire,
shield or do nothing at all. You
reviews of Cassette One. are supposed to make your
However, after going through decisions at the same time as
the programs for a second time, the Z X 8 1 , when it displays its
and taking a closer look at decision and then asks for
them, I feel there is much to be
said for Cassette Two. There is
OTHELLO
J yours. After this it displays
what has happened to each
a good selection of games, and base and the new positions. I
the clear graphics show what IT"5 MY TURN found it hard to resist the temp-
can be done when you have tation of cheating by changing
1 6K to play with. All programs my decisions after seeing what
need more than 1K. YOUR LRST the Z X 8 1 had done. Perhaps
The games on the cassette
MOUE URS: the game could be written so
are by P.Canter and C.Panayi, that this cheating was not
IR-H) possible.
except for Laser Bases and Rec-
tangles by Mr Orwin himself, 3 3 ® t o - © ) = g WORD MASTERMIND: This is a
and P.Rushton's Roulette. I nice variation on the numerical
found no trouble loading the Mastermind games. It has a
programs, which all start MY LRST NOUE vocabulary of over 1 0 0 words
automatically. The instructions URS TO 8 0 which can be changed fairly
are included in the programs for easily. The vocabulary is not in
all but two of them, and rules the visible program, but you
for these are supplied in an ac- won't find it very hard to get the
companying leaflet. >>> I RM THINKING < < Z X 8 1 to reveal what words it is
I'll go through the games one holding. This is a very good pro-
by one. gram, and it really got me think-
OTHELLO: The programming in THE GAME OF RUhRI ing.
this case is unwise (as in most RECTANGLES: Horrorsl The in-
of the other games on the structions for this game come
cassette) with the rules at the on a separate sheet. They read
beginning of the listing, rather like a script for the Monty
than the end, thus slowing Python Show. I haven't a clue
down every GOTO and GOSUB how to play the game, despite
access. You get four options at repeated attempts, and I can't
the beginning of the game: " D o work it out from running the
I play my best?", "Fast or program. Perhaps an example
slow?", "White or black?" and in the rules would have helped a
"Do you want to go first?". The little. In its favour, this program
square chosen by the Z X 8 1 is has a full-screen display, and a
flashed off and on a few times little machine code is included
before it makes its move, to to speed it up.
show clearly where it is playing. CRASH: You use the cursor
The program points out how YOUR SIDE keys to steer your chequered
many pieces the Z X 8 1 is cap- YOUR MOUE
worm to try and trap a black
turing. There are polite com- worm, controlled by the zany
ments on attempted illegal ZXB1, to ensure that it cannot
moves and a comment on the HI - IT"S RRINING PENNIES TODRY move without hitting you or
game when it is finished. The itself. It is trying to do the same
program display is great, but . 3U MRKE ME SHOOT RT THEM EX- thing to you. Very addictive,
the program does not play par- although a touch on the slow
ticularly well. There are much PRESSING RNY KEY AFTER THEY
side. However, if it was any
stronger (and more expensive) faster, I'm sure I'd lose every
Othello p r o g r a m s on the
EEGIN TO DROP.
time.
market. . -JU HFIUE SO SHOTS TO FIRE. ROULETTE: This is a great way
AWARI: This is a game of to try out your betting system
strategy, again with a clear, HFTESS ANY KEY TO PLAY before going to Monte Carlo.
full-screen display. The Z X 8 1 O There are 10 different ways of
plays quite well, but there is no betting, and the system to
option on the level of play, and enter your bets is easy to under-
the whole game is over fairly stand. Although the game
quickly. This program is fairly seems to simulate the rules of
easy to beat. It provides a good 'proper' roulette properly, I
game if you don't think too found that a system I invented
hard. enabled me to amass a vast for-
ZX C O M P U T I N G S U M M E R 1982 106
s o f t w a r e
ROULETTE
ODDS
A N Y N U M B E R = 3 5 T O 1
ANY T U O s l ? T O 1 U E L L D O N E . T H A T U R S R R T H E R Q U I C K .
ANY ROU(3)=11 T O 1 A N O T H E R G R M E ?
.qSGR OP «i=S T O 1
2 R O U S O F 3 = 5 T O 1
1 S T T U E L U E = 2 TO URITE D O W N Y O U R M D U E 5 F O R T H I i
S N D T U E L U E = S T O 1
3 R D T U E L U E = 2 T O 1
T O 1 3 1 3 3 3
ANY C O L U M N = 2
O D D OR E U E N = 1 T O 1 II S S 0 S B m
B L A C K • U M XT E - 1 T O
M R N O U E ( 1 - 1 S ) = 1 TO AY LOT
P f i S S E ( 1 9 - 3 6 ) = 1 T O M N O
Y O U H A U E G O T £ 1 0 0 ©
JU S T U C K RT 1 3
I l I ^ S l L E S 6 S C O R E £ 3 1 M A X .
YOUR STAHC
1 5 : £ 1 & &
I H A U E U O N £l(3tf
S-SHOU
X X XX
X X X X
X X X X
x x x x
X X XX POOO ny. This program is not par- really good additions to the
x x x x b o c ticularly challenging. package. The programs alt
X X X X b o o G U N C O M M A N D : This is show how well the somewhat
x x x x b o o another moving action game limited graphics of the Z X 8 1
x x x x b o o where you try to intercept can be made to perform,
X X X X p o o
missiles traversing the screen. although they also indicate that
x x x x p o o
It's OK, but like PENNY SHOOT
x x x x boo could be a bit more challenging.
there is a temptation to 'dress
up' fairly shallow programs in
p o d S E E
o o o Overall, for the £ 5 this pro- fancy clothes to disguise them.
o o o gram costs, ft represents good Despite all these comments, it
p ot value for money, with the good represents a good selection of
p o i programs outweighing the games. You're sure to find one
p o o weaker ones. However, I feel or two favourites which you'll
that a few of the lower standard play over and over again.
3 games were added more to Cassette T w o is £ 5 from
NOPOR'5TL* f
wxvz make up the numbers than be Michael Orwin.
106 ZX C O M P U T I N G S U M M E R 1982
H i
ZX81 Software
LARGE CHARACTERS
David Kelsall of St. Albans has provided programs to
print wide and double height characters on the ZX
printer. The programs can be combined to produce
16 large letters per line.
REM
REM COPYRIGHT D.U KELSRLL
REM U R N U R R Y 1962
REM
REM PRINT R$
REM STATEMENT IN HEX FOR U=1 T O 32
FOR K = 1 T O ©
P O K E 3 S 2 5 5 f K f 6 » - U - l J ..COL
21 7C 4© CD 91 4© 41 CD
NEXT K
91 4© ED 43 7S 4© G9 ©E NEXT U
FOR H=© TO 31
FF ED 6F CB 47 2© ©4 CB P O K E 16444. + H . H
NEXT H
81 CB 89 CB 4F 2© ©4 CB LET HPRINT=USR 31744
91 CB 99 CB 57 2© ©4. C B
R1 CB R9 CB 5F 2© ©4 CB
SPRINT DOUBLE HEIGHT CHRRRCTERSi
1 IF P E E K 1 6 3 6 6 + 2 5 6 * P E E K 1636
B 1 CB B9 C9 9=31744 THEN GOTO 5
2 R E M P O K E 16369.124-
U : : O EE Q t -I R R R <=;NR E : 3 PRINT "MEMORY NOT R E S E R V E D "
4. S T O P
1 REM 5 7 R N D L N NDIWKEYfLN 5 FOR 1=0 TO 112
*D G O S U B ??RNDTftN CDPV GOSUB 6 P O K E 3 1 7 4 4 +1..PEEK (2161+1)
<-4,?S R C S jjRCS «fRC5 R C S if*RC«b 7 NEXT I
M P C S ?4» R C T Q R C S 0 R C 5 7 4 , fiC5 » « 6 P O K E 31600., 6 3
C S jfpT
iJTRN 9 POKE 31657.201
5 IF PEEK 1 6 3 6 9 = 1 5 4 T H E N GOTO 90 D I M R $ ( 3 2 . 16)
"00 LET B $ = " * P R I N T D O U B L E H E I G H
3 PRINT R E S E R U E M E M (POKE 16 T CHRRRCTERS*"
, 124.) " 110 FOR Y * 1 T O 3 2
4. S T O P 1 2 0 F O R X>=0 T O 1 5
5 FOR 1=0 T O 112 .\30 L E T R $ ( Y ^ X + 1) s C H R % P E E K (76
6 P O K E 3 174-4 +1 , P E E K ( 2 1 6 1 + 1 * 3^+Q*CODE 6*<Y)+XNT (X/fi))
7 NEXT I l'-0 N E X T X
8 POKE 31800 f63 150 NEXT Y
9 P O K E 31657.. 2 0 1 9 9 3 6 REM P R I N T R $ . 6 L I N E S RT R
100 L E T B $ = " U I D E CHRRRCTERS" TIME
1 1 0 D I M R$<32.. 6 ) 9 9 8 9 F O R 1 ^ 0 T O 1© S T E P 6
120 FOR X =2 T O 3 2 STEP 2 9990 FOR J»1 T O 3 2
130 FOR Y * 1 T O 6 9991 FOR K = 1 T O 8
14-0 L E T P s P E E K (7679+6+CODE 9992 POKE 32255+K+6*IU-1>.CODE R
X/2)+Y) $ ( U K+I)
150 P O K E 1 6 5 0 8 . P 9995 NEXT K
160 R R N D U S R 1 6 5 1 4 9994 NEXT U
170 LET R $ J X - 1 , Y ) = C H R * P E E K 156 9 9 9 5 FOR H =0 T O 31
08 9 9 9 6 P O K E 16444+H..H
180 L E T R « (X ,.Y) = C H R * PEEK 165©^ 9997 NEXT H
190 NEXT Y 9998 LET HPRINT=U5R 3174 4
200 NEXT X 9999 NEXT I
ZX C O M P U T I N G S U M M E R 1982 107
1 1 1 l , ,
• J L X t . * • • • m.M-». * .1 JLJLJt .1 t • • • » • * ' r * *-'-'.,T,.'.'.'r'-
1
H .
.v.1..
. ' . V . W
• • • • • • I I
• •
• • • • • • • •ll'
".V
y.S • • • • • • • I
• • • • • • • • I
• • • • • • I I
• • • • • • • • • • • • II
• • • • • * • I
• • • • • • • I I
I • I I I I II
• • • • • • • • •• •• •• I• I'
• • • • • • • I
• • • • • • • •
• • •• •* •• •• •• •• I
• • • •• • • • • • • • • • II
• • • «• *• •• • . •a l Il
•v.v.v
a •- • • l 1l • • a a • • if
I• • •11
I • • * • *• • • •I <1
• a • • • • 11
II •I IM
I • II'
• • •• •• •• •• • •l iI f tl l
• • • • ll
• • * • I I 11
k i l l I I <
\ * a • • l 11
• • • • •
• t •a • * *t l •* «* * t * i • »* »> •i <
h t « * t l i | l * * * l
• •
• •
• •
• •
108 • *
ZX C O M P U T I N G S U M M E R 1982
Moving graphics
Getting into
the Movies
What do you do when you want becomes. This can be over-
come to some extent by assign-
old position while the new one
is being worked out, and these
aliens and asteriods to burn ing two other variables to the are used not as an 'unprint' but
around your TV screen? The PRINT AT position which hold it
for unprinting while the com-
rather to print a trailing series of
full stops, as you can see in
PRINT AT on the ZX81 gives you puter is working out new posi-
tions.
diagram one. Run these pro-
grams a few times, and ex-
one solution. Change the program so it amine the listings, and you're
reads as the listing for program sure to be able to work out
two. Run this, and you'll see ways to make them more effec-
how much more satisfactory it tive.
You make an object move — or although far from satisfactory is. If you want it to run forever, A second way of approach-
appear to move — on the TV in terms of the result displayed add 5 7 IF X greater than 1 9 ing the moving graphics pro-
screen by printing it in one posi- on the screen, at least it should THEN RUN. blem is to use SCROLL to move
tion, holding the display for a give you a clear idea of how to Now moving a blob down the screen up a line, before
moment, then unprinting the produce one kind of effect. Its the screen in an irregular slide is reprinting what you need on the
old position just as you reprint main disadvantage is that the not of much use to anyone. line it has just left. Enter and run
in a new position. screen is blank while the com- Enter and run program number program five, HAILSTORM,
The PRINT AT function on puter is working out the new three, which makes a ball and you'll see how it works in
the Z X 8 1 , although it is slow, PRINT AT position for the black bounce around the screen. practice. In this program, you
makes it easy to position an ob- blob. As you can see from runn- Although this does not use a se- are the black block, PRINT AT-
ject just where you want it. For ing this program, the RND func- cond set of variables to unprint, ted in line 3 0 . You control the
our first simple program, enter tion — when running the com- it is fairly satisfactory. You'll position of the blob by using IN-
PROGRAM ONE and press RUN puter in SLOW — is particularly see that lines 7 0 and 8 0 check KEY$, pressing on keys " 8 " (to
to see it in action. What you'll slow. As you begin to elaborate each time through the program move the blob right) and " 5 "
see, all being well, is a black the program you're working on, to ensure that the ball has not (to move it left). The whole of
square move down the screen and you want the computer to 'hit the sides', and if it has done line 8 0 ensures that the blob
diagonally. Note that you can do more and more, you'll find so, ensures that the variables will not move off the screen,
'chain' PRINT AT commands as this blank between subsequent which determine the next posi- and saves valuable memory by
in line 3 0 . PRINT ATs of the blob becomes tion of the ball (C and D) are placing the interpretation of
This program shows the intolerable. Try, for example, changed. both INKEY $ and checking the
simplest kind of m o v i n g adding 3 5 LET Z = X ' "Y and Program four does use new screen limits on either side,
graphics programming, and see how slow the program variables (E and F) to hold the within one line. Line 9 9 0 prints
ZX C O M P U T I N G S U M M E R 1382 109
mm
Moving graphics
the blank to remove the black file, to see if anything is there. If VAL " 1 " , and CODE " 0 " is Line 5 initialises the vertical
blob. This blank is printed just it finds the code for' 0 " in that cheaper than the number 2 8 . position of the ball, and line 10
before the screen SCROLLS up- position — that is one line In our f i n a l p r o g r a m , sets up the player (black blob)
ward, to move all the zeroes up- below the black blob — it S Q U A S H (program number starting position. Line 1 5 starts
ward. Your aim in the game — knows the black blob is going to six), a ball ( w h i c h looks the count at - 1, which quickly
needless to say — is to avoid hit a hailstone, and prints out remarkably like an asterisk) is becomes zero at line 30, before
the hailstones, as you can see your score, the value of the bounced off a black blob at the the first score is printed. Line
from diagram t w o . You'll variable S. The Q at the end of bottom of the screen, which 2 0 initialises the ball's horizon-
remember that at the start of this line causes the Z X 8 1 to you move right and left by using tal position, and 2 5 initialises
this article we mentioned that stop with a 2 error code, mean- the " Q " and " P " keys. If you the horizontal direction of the
the RND function was fairly ing an unassigned variable has manage to 'bounce it', your ball. Minus one sends it left,
slow. To minimise the delay, been encountered. This is score (shown in the top right zero sends it straight up and
we've used a single pair of ran- 'cheaper', in memory terms, hand corner of the screen) in- plus one sends it right. Line 3 0
dom numbers (generated in than running the line twice, creases by one, and the game increments, the score count.
lines 6 0 and 6 5 ) four times in with THEN STOP at the end of continues. Miss the ball, and Line 8 5 checks to see if the ball
line 7 0 . the second line, or of saying the fun is over. Enter and run and the bat are fairly close, and
Lines 1 0 0 and 1 1 0 are very IF . . . T H E N G O T O 1020, this program to see how it if they are, allows the game to
interesting, and are crucial for where line 1 0 2 0 reads PRINT works. Note that because a ran- continue.
producing a worthwhile pro- S. O t h e r memory-saving dom number does not have to There are a number of simple
gram using the SCROLL facility. devices you can glean from this be generated between suc- ideas presented in this article
Line 1 0 0 moves the PRINT AT listing include the use of VAL a cessive reprints off the ball, the for you to implement in your
position to A + C, B which is a string, instead of using a time the screen is blank is very o w n moving graphics games on
line down from where the black number. Believe it or not, LET P short (only while the computer the Z X 8 1 . We'd be pleased to
blob is at present. Using line = 1 uses up more memory, processes lines 6 5 and 70), so see your favourite program
1 1 0 , the computer then looks because of the way the Z X 8 1 a second pair of variables to which you've developed after
up this position in the display memory works, than LET P = 'hold the ball' are not needed. reading this article.
• Program five
5 L E T Y - 1 6 "
10 LET R =
P • 1 5 LET U =
• » • • 20 LET X — ( R N D * 2 5 +3)
• * • • 2 5 LET D = <RND*3-1)
• • 3 0 LET U =
• • • 3 1 PRINT
0 • 3 5 F O R C =
m 4-0 IP INK = THEN LET R = R -
ft 1
• • 4 5 IF INKE Y $ = " P " THEN LET R = R<-
• a 1
• ft 5 © PRINT RT 21., R - l . ; RT 2 1 , R
* * — 1; "
• • 5 5 IF X-0
ft *
D
• * •
6 0 P R I N T lH T V.. x.;
« • •
6 6 LET Y = » C
m •
7 0 LET X=
• • ft
7 5 PR INT (
• v
8 0 NEXT C
8 5 IF R B S
• Diagram one • Program six
110 ZX C O M P U T I N G S U M M E R 1982
Specialist Book§
i
Choosing program* for microcomputers Introducing computer programming Student notes on NCC OP documentation
1980 J E Lsns £9.00 1979 Reprint W G Collin £11.50 standards
A5 138ppP ISBN 0 8 5 0 1 2 255 4 AS 364ppP ISBN 0 8501 2 2 1 0 4 1978 NCC £5.50
Looks at application packages for micros A machine language independent textbook for A5 10Opp P ISBN 0 8 5 0 1 2 339 9
describing what they ere, the benefit* they offer the beginner, providing all the necessary basic A subset of the full documentation standards for
and their use on microcomputers Guidelines tor information needed by someone starting on a use by students on courses where NCC
obtaining packages and for identifying the best computer programming career. standards are part of the syllabus.
product are given.
Introducing data processing The robots are coming
Elements of BASIC 1980 NCC £6.50 1 974 F H George & J 0 Humphries ledsl
1 979 R Lewis and B H Blakeley £9.00 A5 237pp P ISBN 0 8501 2 245 7 £ 10.00
A5 200pp P ISBN 0 8 5 0 1 2 118 3 Covers the requirements of syllabi for A5 188ppPISBN 0 8 5 0 1 2 1 1 4 0
Introduces the BASIC language, covering the introductory course*. Provide* a comprehensive Gives a general background to current
mathematical, non-numeric and data processing and accessible introduction to data processing. developments in artificial intelligence research
facilities. Generally machine independent with Assume* no previous knowledge of the subject. and looks at where these development* could be
supplements to show the effeci of a number of leading
different implementation*. Introducing microprocessors
1 9 7 9 GL Simons £9.00 Using computers - • manager's guide
Graphics on microcomputers A5 1 77pp P ISBN 0 8601 2 209 0 1 9 8 0 M P e i t u f 7.50
1981 JE Lane £4.00 Gives a profile of the microprocessor scene A5 180ppP ISBN 0 8501 2 241 4
A5 44ppP ISBN 0 8 5 0 1 2 333 X paying attention to typical application areas Intended to help msnager* implement computer
Explores the type of graphics becoming together with hardware and software systems effectively in an organisation. Provides
increasingly available in low cost systems. information. an introduction for user management covering
Illustrates the facilities available and takes a the topics of planning and control plus human
closer look at graphics picture building Introducing word processing factors
techniques. 1981 G L Simons £8. SO
A5 1 BOpp P ISBN 0 8 5 0 1 2 3 2 0 8 Working w i t h computers: a guide to jobs
Information handling by microcomputers Describes the main characteristics of word and careers
1981 JE Lane £4.00 processing and discusses its advantages over 1975 £2 50
A5 60pp P ISBN 0 8501 2 334 8 conventional typewriting. Communication, A5 86pp P ISBN 0 B501 2 126 4
Examines the field of information handling on maintenance, security and costs are considered A general introduction to computing as a career
microprocessor* across the whole spectrum of for school leavers. Cover* how a computer i*
micro applications Aims to promote an Operating systems for microcomputers used, what types of job exist and how lo irem
awareness of current practices and trends 1981 J E Lano £3.50 for them.
A5 77ppP ISBN 0 8501 2 277 5
NCC N C C £6
Establishes the requirements of operating
systems for microcomputers in both commercial
and industrial application areas and examines
the facilities provided in a number of current
THa hbtanai Compitng Cffflr* products. Th» (Miami Cotpum*
W e ere now able to offer, in addition to our usual selection of books on computers, a number of specialist titles from the National
Computing Centre.
Rather than taking their entire list of some 1 1 0 titles, w e have selected those most relevant to the microcomputer market and these are
listed w i t h their precis.
Ordering couldn't be simpler, just tick the boxes in the form below, enclose a cheque or postal order to the total amount tor make use of
the Barclaycard end Access facility) and send it all off to:
SPECIALIST BOOKS,
ZX COMPUTING
145 CHARING CROSS ROAD,
LONDON W C 2 H OEE.
If you are using your credit card to order please don't send it, |ust fill in the number and sign on the dotted line.
Please allow 2 8 days for delivery of your books.
Name: .
Address;
Amount:
ZX C O M P U T I N G S U M M E R 1982
m 111
Review
Mewson's hints
cmdjtips
Hewson Consultants
have a variety of ZX81
products — including
games software,
'serious' software, and
andrew Hewson's book
'Hints and Tips for the
ZX81'. Graham Charlton
puts them through their
paces for zx Computing.
mm • »t
' • ; •^ J
ZX C O M P U T I N G S U M M E R 1982 112
Review
••.v.-
•v.v
/.V.' - RJ J itti
•88
• •»
A."--." .v»v •V/-
* rt k «• « . !& it till uu » »
M»
A * • •
a?}
III! 1111 (III IJJj
i! ii cili
ill!
Hit Hi! ill!
O Z J I J L I* » JTA. _
y i g t 5 P A G E X N 7 R U D E RE-
SUCRE = 2 5 8 B E S T S C O R E = "7"? 7
A big bundle of material from cross-referenced. The book Language paper could achieve — and
Hewson arrived at my home,
and I spent a long weekend
eases the user into the idea of
using machine code, with
Dictionary probably in less time than it
takes to locate and load the
working through it. The many examples of its use in Written for a Z X 8 1 with 1 6K, required program. Of course, it
products I looked at. and their the book. Language Dictionary is an would be valuable if a large
prices, were the book 'Hints As well as this, I found the easy-to-use program, with a number of similar problems
and Tips for the Z X 8 1 ' chapter on chaining programs number of options. It can had to be worked through. At
( £ 4 . 2 5) Space Intruders quite enlightening. I didn't search for a word in either of the very least, the programs
( £ 5 . 9 5 ) , Language Dictionary know, until 1 read it here, that the languages used, allows prove convincingly that the
( £ 3 . 7 5 ) and Planet Lander it was possible to pass data you to update or dump the Z X 8 1 can be used for more
(£3.75). between programs. In all, this entire contents or to save than games. Perhaps a 16K
The area covered by the slim volume is good value, and these on cassette. Although maths tape would be more
hints and tips book is shown an essential aid to those with the method used to store the useful, and would provide a
clearly by the chapter titles: an unexpanded Z X 8 1 . words packs them tightly it better indicator of the Z X 8 1 's
Saving Space; Understanding appears it would take a long abilities.
the Display File; Converting time to find a word stored near
2 X 8 0 Programs; Chaining
Programs; Machine Code; plus
Space intruders the end when the dictionary
was full. Planet Lander
a mixed bag of twelve 1 K
programs. This program, for a Z X 8 1 with
16K, comes dubbed once on Statistics This tape contains four 1K
programs. In Planet Lander
The book appears to be each side of a cassette, along This pack consists of three 1 K you have to (yawn) land your
aimed mainly at those with with full instructions. Even if programs — Graph Plot, which spacecraft on a planet's
only 1 K RAM. if you have only you'd never used a Z X 8 1 does exactly as the title surface. Stopwatch is self-
1K, I'm sure you realise how before you got this program, suggests, .using data entered explanatory. The third
difficult it is to run even the the instructions would enable from the keyboard; Chi program is Space Docking, in
smallest of programs. you to load and use the Squared Test, which which (yawn again) you have
Therefore it is essential to computer. Written in machine "calculates the value of the to dock your spacecraft with
understand how your Z X 8 1 code for fast action, the chi squared statistics for the space station. The final
works, and know some short program has 4 0 alien ships in comparing observed and program is Clock, in which you
cuts to help you in each squadron, three laser expected values"; and set the time and then sit back
programming. This book guns and full score display. As Statistics, Regression, Trend and watch the display
should help you. 'Hints and well as this, the Z X 8 1 can which is used to calculate increments each five seconds.
Tips' contains an extensive play itself — although not very mean and standard deviation T w o of these programs are
2 7-page chapter on machine successfully. Continuous firing and a least squares regression available from the book Hints
code, although it doesn't give is available, and you have to line or trend line. I am sorry to and Tips' so I suggest you buy
a full list of codes. Hewson be quite quick to avoid the say that these programs the book. You'll learn a fair
Consultants do supply, for aliens' bombs. All in all, this is appear to do little more than amount, and enjoy using the
£ 1 . 4 5 , a full list, in which an enjoyable version of the someone with a pocket book far more than you will
each Op Code is explained and popular arcade game. calculator and a piece of graph this last pack.
ZX C O M P U T I N G S U M M E R 1982 113
Machine code
114 Z X C O M P U T I N G S U M M E R 1982
Machine code
the new address (in decimal)
followed by NEWLINE. I spent
It didn't Crash In Summary 3. It can be saved.
Using the experimental pro-
many happy minutes stepping gram also allows you to step
through Clive's ROM after I accidentally displayed the This will definitely be my through and examine the ROM
entering " N " NEWLINE, 0 REM statement with the code in favourite method of entering and incidentally, run parts of
NEWLINE, followed by a suc- it and to my amazement it machine code since: the ROM, to find out start ad-
cession of NEWLINEs. If you didn't crash. Where it en- 1. It's immobile and absolute dresses of useful subroutines.
have the patience you could list countered a naughty code, addressing can be used. Use the program and have a
and disassemble the ROM clever old Clive's ROM simply 2. It's crash proof even if REM dabble with machine code
(please send me a copy). Any told it to display a question is displayed. yourself.
area of RAM or ROM can be ex- mark.
amined in this way. If you have
the program operating correctly
the first ten bytes of ROM
should read:
Producing a Bleep
So GOTO 1 0 followed by
NEWLINE produced 1 6 5 1 4
3 8 . The 3 8 was simply the first
letter A of my REM statement.
The following code was then
written in:
ZX C O M P U T I N G S U M M E R 1982 116
Programs
BIORHYTHMS
—
The 'science' of bio-rhythms is 1
based on the belief that each of I * * * I I 1 I ! I !
us is in the throes of three cycles
which start at the moment of birth • 1 * 1 * 1 1 1 1 ! ! * ! # * * I 1f * :
and continue until death. Hfl I * i ! ! * ! ! I ! I t * M I
PHYSICAL: The 23-day physical
cycle relates to endurance, aggres- * * 1*1 I * I f I * I * ! t *
siveness and physical strength. 1 I * I !* * I ! t * I i* I i
EMOTIONAL: The 28-day !
emotional cycle governs emotions, * * I I i V 1
H *
optimism/pessimism,
temper and moodiness.
frustration, I ! i* ! I I
MENTAL: The 33-day mental * I t i I i 1 1 I I I I--' i»f H i l*$ HIM4*+++-1 -H-H
rhythm is related t o logic, reason- ! j * i : i It ! f ! it I
ing, ease of expression and common
sense. It i i I ! * I * I I * ! I I -
! ! I * 1*1 i f t I + i i* I I *
This program takes your date of
birth, then the date of the day !# ' * i I I * 1 * !
which interests you, and works out I .+ i I ! I I i v l I I 1
the 'worst point' on each of the
three cycles in relation to the day ! I ! i ! + I* I i * 1 * 1 1 f
you have nominated. I ! ! I*** 1
I I I I I f *
Here at last are some serious (and some fun!) T W O GREAT ZX81 16K
programs which all run in IK. CHESS G A M E S
Don't be misled by the titles: 'Roulette' actually
ZXCHESS( ENHANCED)
* Written totally in machine code
analyses gambling systems; 'Chinese Horoscope' * Full graphic display o l Chess board.
reveals your birth sign, month sign, element and * Six levls of play Two play within competition time limits
ascendant; 'Payroll' handles ALL tax bands. These * Option to play Black or White
are not just simple programs. * Plays all legal moves including castling and en passent
* Cassette routines for saving unfinished game and returning to
later.
FREE OFFER!!! * Displays moves of game on screen or printer for analysis
A free listing of 'Chess in IK' is included with all * Print a copy of the Chess board onto the printei
* Board can be set up in any position, you can even swap sides
mail-orders mentioning this magazine! midgame
* clear whole board with one command for end game analysis
'What Can I Do With 1K?' is available from most £6 50
bookshops, computer shops, or direct frorn:-
ZXCHESS II W e
W i e v e the strongest ZX81 Chess game as
V & H Computer Services no other has beaten ill I
* All the features of ZXCHESS plus
182c Kingston Rd. * Book of 32 opening moves
* Seven levels of difficulty: FOUR play within competition time
Staines Middx. limns
* A move is suggested by the ZX81 if wanted
Tel: Staines 58041 * Optional Full Graphic version using the QS CHRS Board
£1299
2 copies supplied on cassette with full instructions
Price £4.95 (inc. p&p). Cheques and postal orders payable to
II you do not wtsh to use ths coupon write, staling your requirements.
To Pnnt Y Plotter Products ZXllS Borougfi Hqh Strut" London SM 9SF
• Please send me . JOTTERS @ f 3 50 • Please send me. fllMS @ f ? 25
• Please send me MANUALS @ CI 00 (CI SO if ordered without JOTTER or f l l M )
• Remittance endosed • ftn my Access/Visa No
• ZX81
2hole* # ^ Keyboard.
punched. ^ Numbered
PRINT Grid. Program Address
Numbered notes space
PLOT Grid.
100 Sheets. S i » A 4 . Hon Ordm i n ututih petnd MHA* I I kauri el m > ) i II r*> rt^unt IK Clan m i p«tn (M Mo to orfei
Board backing.
Av«KH**l< M h Men »4iWhan H U London SWlt • O n v > Bootiaat'i 2Cwltmwn Si London EC 1 • M*'o-»« 1)1 • »D m « l r
ZX C O M P U T I N G S U M M E R 1982 117
Computer Glossary
COMPUTING GLOSSARY
Batch (Processing) A method Block A sequence of data Bus (sometimes spelt Buss)
of computer working in which words or bytes treated as a Basically means the multiple
a large number of unit, especially when working wiring common to several
transactions are grouped with magnetic tape. parts of a computer and the
together before processing number of channels therein —
(so that control totals, etc Boot An instruction or very eg a 16-bit bus addressing
Address The number, eg can be taken) and which are short program which will 6 4 K memory locations or a
6 2 7 6 8 , identifying a place in then passed through the initiate a computer's 2 0 - w a y bus addressing 1
memory, various stages of processing operating system (short for megabyte. Bus is now
as a group or batch. This was bootstrap). generally identified with the
Aluminised (paper) Printer the original method of data pattern of connections to the
paper surfaced with a thin processing for commercial bps Bits Per Second — a rate plugs and sockets whereby
deposit of metal. The work and contrasts with of data transmission between optional units (eg more
characters are formed by interactive and demand devices. Eg 3 0 0 bps is a memory) may be connected
darkening caused by electric processing. popular rate for some to a computer.
current flowing onto the terminals, roughly equivalent
paper from the pins of a Baud A rate of data to 3 0 characters per second Byte A unit of data 8 bits
matrix print head. transmission commonly, (cps or chps). long.
though strictly not correctly,
ASCII American Standard taken as synonymous with Bubble memory A compact,
Code for Information bits per second. high-capacity random access
Interchange — representing memory device which holds
letters, numbers etc by 1 2 8 BCD Binary Coded Decimal - data as minute magnetic
permutations of a 7-bit code. a 4-bit system for domains or 'bubbles'. The
representing the 1 0 decimal data is not lost when power
Assembler Program which digits. is removed. C A D / l / l Computer Aided
converts the low-level Design/Instruction/Learning.
mnemonic instructions of Benchmark A standard Buffer (1) An area of memory
assembly language to the computing task used to designated to hold data being Cartridge A protective carrier
binary machine language measure the relative speeds transferred between devices of magnetic tape (a variant of
instructions required to drive of different processors. working at different speeds, the familiar cassette) or disc.
a centra! processor. eg the fast processor and the
Binary Numbering system slower keyboard, printer or Central processor The heart
with the base 2. using the disc. of a computer in which the
digits 0 and 1 instead of the (2) An electronic actual program instructions
decimal series 0 to 9. All device in a signal path are effected.
digital computers work on designed to allow signals to
data and instructions pass in one direction but to Chain A process whereby one
presented as binary numbers. hold back unwanted reverse computer program
BASIC Beginners' All-purpose voltages which might damage automatically follows another.
Symbolic Instruction Code — Bit Binary digit (contraction). the sending apparatus.
a popular high-level Must be 0 or 1. COBOL Common Business
programming language Bug An error in software. Oriented Language.
developed at Dartmouth
College, USA.
118 ZX C O M P U T I N G S U M M E R 1982
Computer Glossary
Compiler A program whose
function is to read another
program written in a high-
level language, such as
COBOL or FORTRAN, and
convert it to machine code
which a computer can obey.
CP/M Control
Program/Microprocessor. A
popular disc-based operating
system for microcomputers
using the 8 0 8 0 and Z 8 0
processors.
ZX C O M P U T I N G S U M M E R 1982 119
DOS Disc Operating System FORTRAN Formula
— a computer operating Translation, an early and still
system held on magnetic disc popular high-level
rather than in ROM. An programming language,
initialisation process will copy mainly used for scientific
the operating system into purposes.
memory whenever the
computer is first turned on.
Also an operating system
which controls the disc
themselves and may
supplement, rather than
replace, the computer's
original operating system. Golfball A type of typewriter
(or the print head from which
Duplex A mode of data it gets its name) in which the
transmission where each print characters are embossed
station can send and receive on the surface of a sphere
simultaneously. very similar in size to a
golfball. Rotation of the
Dynamic (Memory) Random sphere brings the appropriate
Access Memory (RAM} character into line for each
requiring constant refresh required impression. The
signals but normally using process is usually slow (1 5
less electrical power than cps) but of good quality.
static memory,
Hard Copy A
computer printout or
EAROM Electrically Alterable listing on paper.
Read Only Memory. Typically
taking 10 mSec to erase and Hardware The
1 msec to write, this non- physical elements of a
volatile storage might be computer (contrasted
better considered as 'Read with software).
Mostly Memory' as the write
capability is likely to be High-Level Language
limited to say 1 0 0 , 0 0 0 Programming
cycles. language usually
claimed to resemble a
Edit Alteration of text in natural language, and
program or data files. Often with powerful
necessary, some systems instructions, each
make editing easier than generating several
others. machine language
instructions. Examples include
EPROM Erasable BASIC, COBOL and
Programmable Read Only FORTRAN.
Memory. Writing typically
takes one minute and erasing,
by ultra-violet light, 10
minutes or longer.
Intelligent terminal An
input/output device
which includes its
own logic circuits and
memory so that, for
Firmware Instructions or data instance, data may be
permanently stored in ROM. validated or changed
in format before
Floppy (disc) A mass-storage transmission to the
device comprising a soft main computer.
(floppy) plastic disc with
megnetisable surface on Interactive A working
which data is recorded and arrangement under
may be accessed rapidly by a which the computer
moving read/write head. The reacts immediately to
disc, either 8 " or 5 % " respond to any
diameter, rotates inside a mistakes which may
protective cardboard sleeve. be made by the user
120 ZX C O M P U T I N G S U M M E R 1982
Computer Glossary
or to reply to his
enquiries as soon as
they are expressed. In
some business
activities, as also in
program writing, this
leads to much faster Light Pen A stylus with a light
progress than would sensor which allows a
otherwise be possible. computer to identify the point
at which a Video Display Unit
Interface The fVDUJ screen is being
interconnection touched.
arrangements
between a computer Line Printer A computer
and devices, such as peripheral which prints a
printer or modem, whole line at a time, instead
attached thereto. of doing each character
sequentially.
Interpreter A program
to translate a high Load To copy a program leg
level language from tape or disc) into
(typically BASIC) to memory, ready for execution.
rpachine language and
to execute each LSI Large Scale Integration
instruction, line by the combination of circuit
line, immediately. elements in a small silicon
chip.
Interrupt A signal
which suspends
processing to allow
some other command
to be obeyed.
I EEE Institute of
Electronic and
Electrical Engineers (in Machine Language (code) The
USA) — a body which lowest (and tediously
has set a number of detailed) level of program
standards for more instructions. All higher level
orderly interchange of coding must be converted to
information between machine language (by
various electronic compiler or interpreter) before
devices, including a processor can obey it.
computers.
Mainframe A relatively large
I/O Input/Output. computer.The term derives
from times before integrated
Impact (printer) One circuits, when processors
which forms were wired up with large
characters by striking numbers of separate
a ribbon on to paper components mounted on
and can therefore circuit cards or boards which
produce carbon were in turn mounted in metal
copies. racks or frames enclosed in
one or more large metal
Integer BASIC cabinets.
Concerned only with
whole numbers, Matrix (printer) Printer whose
cutting off any characters are formed by
fractions or decimal parts. selecting a pattern of dots
from a matrix typically five
dots wide and seven high.
ZX C O M P U T I N G S U M M E R 1982 121
Computer Glossary
Microprogram A very low Pascal Program language,
level Of programming, designed to facilitate
normally implemented in ROM structured programming
by the processor's especially on small interactive
manufacturer, to increase in machines. Named after
effect the set of instructions Gabriel Pascal.
which the processor can
obey. Patch A small piece of
computer program inserted in
Minicomputer A somewhat a longer program to remedy
vague term for the middle some bug or defect in it.
range of computers.
Machines addressing up to Peripheral Device attached to
64K bytes or words of a computer, eg printer,
memory tend (at the present plotter, disc unit, but not
time) to be called necessarily essential to its
microcomputers and use.
machines able to address
more than 64K memory PILOT A programming
locations tend to be called language for small computers,
minicomputers unless they designed to be particularly
separate into distinct parts, in appropriate for teaching in
which case it may be called a schools.
mainframe.
Plotter Computer-driven
Mini floppy The smaller size graphic display using pen on
of floppy disc. 5'/« " paper.
in diameter.
PROM Programmable Read
Modem Acronym for Only Memory.
MOdulator/DEModulator — a
device adapting computer
data for transmission by
telephone line and vice versa.
R S 2 3 2 A communications
interface used for modems
and for serial printers.
122 ZX C O M P U T I N G S U M M E R 1982
Computer Glossary
Time-Sharing A method of
operating a computer
whereby two or more users
apparently enjoy simultaneous
access to and control of the
machine. In practice what is
happening is that the
computer is attending to the
users one at a time, but in a
sequence of time intervals so
short that none is normally
aware of any delay.
ZX C O M P U T I N G S U M M E R 1982 123
SQUAREOLOGY
turns to link dots in a matrix, with The patterns 1-9 will fill up
6 0 or so moves in the matrix
each player trying to avoid placing and then return to "Your
move". Patterns from A-Z may
a line in such a manner as to allow or may not start with "Your
move", and some squares may
a player completes a square, it is " / " in the centre and are not
counted on the score. If 0 is the
marked for the player, who then choice of pattern then no pat-
tern will be produced and the
124 ZX C O M P U T I N G S U M M E R 1982
16K Programs.
After taking your move the becomes Q and vice versa.
c o m p u t e r will react " M y Lines 1 3 0 - 1 3 4 sort out the
move" followed by "Search". score. If all 8 8 squares are
The search routine then checks taken then the game finishes at
all 1 9 5 possible moves to see if line 1 4 4 where pressing any
it can claim any squares. If it key starts another game.
can, it will complete the square Otherwise line 1 3 6 starts the
and start again with " M y next turn by jumping back to
m o v e " . Unfortunately the line 6 4 .
search takes approximately 1 2 Lines 1 5 0 - 1 6 6 Starts the
seconds. This routine may be search routine during " M y
altered to a FAST mode by in- turn" using part of Sub 4 4 0 ,
serting a new line 1 5 3 FAST only this time Q = 3. If L or
followed by a new line at 1 6 7 M = 1 then its found a three-
SLOW. sided square. In this case line
This means that the screen 2 0 0 - 2 1 0 loop around until the
will blank out for a couple of missing side position is found.
seconds during the search, Since " M y turn" looks directly
which in my opinion is not so at a position (I) and doesn't
good. If the search is unsuc- choose X, Y co-ordinates then
cessful the word "Search" is sub routine 4 7 0 supplies X, Y,
followed by an " X " after which and E. it then jumps back into
it makes its choice of move. the original program at Line
This is reasonably fast and nor- 1 0 6 having worked out its
mally takes only a second or move.
two depending on the complex- Lines 1 6 8 - 1 9 6 constitute the
ity of the situation. It does this computer's turn if the search
by the simple reasoning: if one for three sides is unsuccessful.
of its choices is impractical then This will choose any untaken
it will not take that move into position. G:-lndicates if there sides altogether (eg in this case position other than one which
account again. are any safe moves left. I:-Is us- Q = 4 thus any four sides in any will make up more than two
When the grid becomes so ed to search/ modify the data in four directions will let J, K, L or sides in any square. (Q = 2 this
full that it is impossible to move A. M at least equal 1). time.) It starts at position two
without giving any squares Lines 2 8 - 5 2 set up the display Lines 1 1 8 - 1 2 6 If the four sides (I) and jumps in steps of 6 0 , to
away, the program is not able to grid etc. of a square are present, then find a suitable position. If
take into account how many Lines 5 4 - 6 0 set up D which is the program will go to various l > 1 9 5 then let 1 - 1 - 1 9 3
squares you can claim from its used for the pattern routine. parts of subroutine 4 8 0 . This keeps this within the " A "
move. For this reason the com- Lines 6 2 - 6 4 set up " M y routine works out by J, K, L or boundary. This tests each
puter scores two points for score", "Your score". These M, the direction of the print number from 2 to 1 9 5 without
every square it takes. look better in inverse charac- statement, which will 'black' repeating, looking reasonably
The ultimate object being ters. Sub 4 2 0 simply blanksout the squares and insert an "*" a at random.
not only to win, but to beat the the line at 1 9, 0; and sets the " - " or a " / " depending upon Once 1 9 5 is reached G = 1
computer 8 8 to 0 , which is next print position again for this w h o s e m o v e c l a i m e d the and Q = 4 allowing the next
almost impossible. If, however, line. square. available position to be taken.
you beat it by 5 0 points (which Lines 6 6 - 7 2 sort out whose This simply takes the value This time at line 1 9 6 we return
is very difficult), the coveted move. (The pattern starts at of whose turn (in C) adds 2 2 to the main program 104, to
"Congratulations" line prints 2 2 0 . The " M y m o v e " starts and prints the CHR $. U is simp- allow a little longer to display
up. at 1 50.) ly used to help simplify the print the " M y moves" choice (line
The BREAK key will stop the Lines 7 4 - 1 0 0 set up all the statements. 1 9 4 ) . (X * 2 + 3 7 + E) works
program at any time. (This can variables and traps for "Your Line 1 2 8 If there is no pattern or out the relevant letter.
be useful for sampling the pat- moves" choice. X - Value for winning move then let C = ABS Note: If you wish to set up
terns by simply: BREAK, RUN, the position acrots the grid. ( C - 1 ) . This changes the the pattern fast then insert Line
another choice of pattern This can be from 0 to 11. (0 for player's turns. If C = 1 it 2 2 1 FAST and line 6 9 SLOW.
number.) Working out where A, 1 for B and C, 2 for D and E
the computer is going to move etc.) This, together with infor-
next has been deliberately mation of whether an odd or
made difficult to follow after its even line number down, sorts
first couple of moves. out the print position. This ar- 2 CLS
rangement prevents illegal en- 4 PRINT " S Q U A R E O L O G Y " , „ " B Y J. ENNESS"
The Program tries on the dots or in the middle
of the squares. Y = the up/
6 PRINT AT 3 , 3 ; " T H E OBJECT OF THIS GAME IS TOJOIN
THE DOTS AND COMPLETE A S " , " M A N Y SQUARES AS
Lines 2 - 1 0 set up the instruc- down position. POSSIBLE. T H E " , " COMPUTER ALSO TRYS THIS: AFTER
tions. Note:- Double words, (eg Line 1 0 2 goes to the last line of " , " MAKING THE FOURTH MOVE ON A N Y ' V ' T H I R D
fora) are separated by the end Sub 4 7 0 to get the odd or even SIDE."
of one line and the beginning of number which is stored in E. 8 PRINT " [ ] ( ] [ ] THE COMPLETION OF A SQUARE
the next. E = 0 for even, 1 for odd. " / ' W I L L BLACKEN THE GREY LINES A N D " , " P U T AN
Line 12 goes to an inkey $ trap. Lines 1 0 4 - 1 0 6 again prevents . » O R " " - " " IN ITS CENTRE"," NOTE:-THE
(Sub 4 0 0 . ) The program will illegal entries and prevents COMPUTER SCORES T W O ' Y ' P O I N T S PER SQUARE YOU
not continue until a key is press- entering a move already taken. LOSE."
ed. The value of the key is Lines 1 0 8 - 1 1 0 store and print 1 0 PRINT " [ ] [ l t ] TO START SELECT A PATTERN
recorded in Z $. Not used in this a move. 1 - 9 0 R " " 0 " " FOR NO PATTERN OR A-Z FORA
case. Line 1 1 2 Q = The number of MYSTERY START. TO ENTER A MOVEPRESS THE
Lines 1 6 - 2 6 set up the sides to be taken into account in LETTER THEN N U M B E R / S ' V ' O F THE REQUIRED
variables. A:- Keeps a record of Sub 4 4 0 . Sub 4 3 0 simply zeros POSITION. T H E " , " W I N N E R OF A SQUARE HAS A
the 1 9 5 possible moves. J, K, L and M in Sub 4 4 0 these SECOND M O V E . " , , " [ ] [ 1 [ ] ( ] PRESS ANY KEY
V:-Records the score. C:- variables change to 1 if anytjf TO START"
Defines "whose m o v e " . F:- the four directions possible 12 GOSUB 4 0 0
Starts the computer's turn from a position has Q number of 14 CLS
ZX C O M P U T I N G S U M M E R 1982 125
16K Programs.
16 DIM A ( 1 9 5 ) 160 GOSUB452
18 DIM V(3) 162 IF L OR M = 1 THEN GOTO 2 0 0
20 LET C = 2 164 NEXT I
22 LET F = - 5 8 166 NEXT A
24 LET G = 0 168 PRINT " X " ;
26 LET 1 = 0 170 LET Q = 2
28 PRINT " [ ] [ } [ ] [ ) [ ]"; 172 LET F = F + 6 0
30 FOR A = 3 8 TO 6 0 174 IF F = 1 9 5 THEN LET G = 1
32 PRINT CHR$ A; 176 IF F > 1 9 5 THEN LETF = F - 1 9 3
34 NEXT A 178 IF A ( F ) > 0 THEN GOTO 1 7 0
36 PRINT 180 LET I = F
38 FOR A = 2 TO 18 STEP 2 182 GOSUB470
40 IF A < 1 0 THEN P R I N T " [ ] " ; 184 IF G = 1 THEN GOTO 1 9 4
42 186 GOSUB 4 3 0
• • 188 GOSUB 4 4 0
44 IF A = 18 THEN GOTO 5 2 190 I F J + K + L + M > 0 THEN GOTO 1 7 0
46 IF A + 1 < 10 THEN P R I N T " [ J"; 192 GOSUB430
48 P R I N T " [ ] [ ] [ ] " ; A + 1,, 194 PRINT '* [ 1"; CHR$ ( X * 2 + 3 7 + E ) ; " - " ; Y
50 NEXT A 196 GOTO 1 0 4
52 PRINT A T 19,0;"PATTERN REQ. 1 -9: OR MYSTERY 198 REM SEARCH SUCCESS
A-Z" 200 IF L = 0 THEN LET L = - 1
54 GOSUB 4 0 0 202 IF A(l> = 0 THEN GOTO 2 1 2
56 LET D = C 0 D E Z $ 204 LETl = l + 1 1 *L
58 I F Z $ = " 0 " THEN LET C = 1 206 IF AO) = 0 THEN GOTO 2 1 2
60 IF Z$ > " 0 " AND Z$ < " A " THEN LET D = VAL Z$ * 4 + 3 8 208 LET 1 = 1+ 1 *L
62 PRINT AT 2 1 , 0 ; " M Y SCORE"; AT 2 1 , 1 5; "YOUR 210 GOTO 2 0 2
SCORE 212 GOSUB 4 7 0
64 GOSUB 4 2 0 214 GOTO 1 0 6
66 IF C = 1 THEN PRINT "YOUR M O V E : " ; 218 REM PATTERN CHOICE
68 IF C = 2 THEN GOTO 2 2 0 220 IF 1 > 0 THEN NEXT B
70 IF C = 0 THEN PRINT " M Y M O V E : " ; 222 IF l > 0 THEN LET C = 0
72 IFC = 0 THEN GOTO 1 5 0 224 FOR B = 1 TO 6 0
74 GOSUB 4 0 0 226 LET 1 = I + D
76 IF Z $ < " A " OR Z $ > " W " THEN GOTO 7 4 228 IF I > 1 9 5 THEN LET I = I - 1 9 3
78 PRINT " [ ] " ; Z $ ; " - " ; 230 GOSUB 4 7 0
80 LET X - INT ((CODE Z$ - 3 7 ) / 2 l 232 GOTO 1 0 6
82 LET Y = 0 398 REM INKEY$
84 GOSUB 4 0 0 400 IF INKEY$ < > " " THEN GOTO 4 0 0
86 IF Z$ < > " 1 " THEN GOTO 9 4 402 IF INKEY$ = " " THEN GOTO 4 0 2
88 LET Y = 10 404 LET Z$ = INKEY$
90 PRINT " 1 " ; 406 RETURN
92 GOSUB 4 0 0 418 REM PRINT BLANKS
94 IF Z$ < " 0 " OR Z$ > " 9 " THEN GOTO 6 4 420 PRINT AT 1 9 , 0 ; " I ] [ ] [ ] [ ] [ ] [ 1 - Line of 3 2
96 LET Y = V A L Z $ + Y spaces — [ 1"
98 PRINT Z$ 422 PRINT AT 1 9 , 0 ; " [ 1 [ ] [ ] " ;
100 LET l = X + ( Y - 2 ) * 1 2 - INT ((Y - 21/2) ' 424 RETURN
102 GOSUB474 428 REM ZERO SEARCH VAR.
104 IF Y < 2 O R Y > 1 8 OR E = 0 AND X = 0 THEN GOTO 6 4 430 LET J = 0
106 IF A ( l ) > 0 THEN GOTO 6 4 432 LET K = 0
108 LET All) = 1 434 LET L = 0
110 PRINT AT Y - 1 , X # 2 + 4 + E ; " # " 436 LET M = 0
112 LET Q = 4 438 RETURN
114 GOSUB430 439 REM SEARCH AROUND 1
116 GOSUB440 440 IF E = 0 THEN GOTO 4 5 2
118 LET U = X * 3 + 4 442 IF X > 1 0 THEN GOTO 4 4 8
120 IF M = 1 THEN GOSUB 4 8 6 444 IF A(l) + AO + 1) + A(l + 1 2) + AO - 1 11 = Q THEN LET J - 1
122 IF L = 1 THEN GOSUB 4 8 4 446 IF X < 1 THEN RETURN
124 IF K = 1 THEN GOSUB 4 8 4 448 IF A(l) + AO - 1 > + AO - 12) + AO + 1 11 = Q THEN LET K = 1
126 IF J = 1 THEN GOSUB 4 8 0 450 RETURN
128 IF C < 2 AND J + K + L + M d THEN LET C = ABS (C - 1) 452 IF l > 1 7 2 THEN GOTO 4 5 8
130 LET V(C + 1 ) = V(C + D + J + K + L + M 454 IF A(l) + AO + 1 1 ) + AO + 12) + A(I + 2 3 ) = Q THEN LET
132 PRINT AT 2 1 , 9; V ( 1 ) ' 2; AT 2 1 , 2 7 ; V ( 2 ) L= 1
134 IF V(1) + V(2) + V(3) = 8 8 THEN GOTO 1 3 8 456 IF I < 2 4 THEN RETURN
136 GOTO 6 4 458 IF A(l) + A(l - 1 1) + AO - 12) + AO - 23) = Q THEN LET
138 GOSUB 4 2 0 M =1
140 PRINT " I W O N - HARD LUCK" 460 RETURN
142 IF V ( 1 ) * 2 < V ( 2 ) THEN PRINT AT 1 9 , 3 ; " Y O U W O N - 468 REM FIND E.X.Y. FROM 1
WELL DONE" 470 LET Y = INT (0 + ( 0 + 1 1 ) / 2 3 - 1 ))/12) + 2
IF V ( 1 ) * 2 + 5 0 < V ( 2 ) THEN PRINT AT 1 9 , 0 ; " W O N BY 472 LET X = I - ((Y - 2) • 1 2 - INT «Y - 2 ) / 2 »
CO
126 ZX C O M P U T I N G S U M M E R 1982
WHAT'S ON NEXT?
IN HOBBY ELECTRONICS
• • 15 • 3Er The HE
• 1 E• 1 FFC3 MicroTrainer.
mm n a • n m • H• D
mM i i 1B •k C3B5
• a • a a 3FF
W1
n. i E ED H K n i* PROJECTS FOR
— • a • c s a • E
EVERYONE
«
w F E Dc • • • D
or 1— 3 H •
XI T3E
X if • • • • FB * Light-Operated Power Switch
p 1 K E• 1 FC * Auto-Wah Effect
n DX % E • * Greenhouse Monitor
#
Telephone Timer
* Power Supply Design Project
ZX C O M P U T I N G S U M M E R 1982 127
Specifications
MACHINE
SPECIFICATIONS
ZX80 Immediate mode
The Z X 8 0 will function in the "calculator mode" by immed
iately executing a statement if it is not preceded with a line
number.
Dimensions Cassette interface
Width 174mm (6.85 in) Works with most domestic cassette recorders. The transfer rate
Depth 218mm (8.58 in) is 250 baud using a unique tape-recording format. Other
Height 38 mm (1. 5 in ) systems are not compatible with the ZX80's. The Z X 8 0 also
Weight 300g (10.5oz> SAVEs the variables as well as the program on cassette. There-
fore you can save the data for updating next time the program
Microprocessor/Memory is executed. The Z X 8 0 does not support separate data files. The
Z80A 3.25 MHz clock lead supplied with the Z X 8 0 is fitted with 3 . 5 m m jack plugs.
ROM: 4K bytes containing BASIC Expansion bus
At the rear has 8 data, 16 address, 13 control lines from the
RAM: I K bytes internal, externally expandable to 16K bytes. processor and Ov, 5v, 9 11 v, 0 and internal memory control
line. These signals enable you to interface the Z X 8 0 to your
own electronics, PIO, CTC, SIO if you want I / O ports etc.
Display Power supply
Requires an ordinary domestic black and white colour T V . The The Z X 8 0 requires approximately 4 0 0 m A from 7 - 1 1 v DC. It
lead supplied connects between the Z X 8 0 and your TV's aerial has its own internal 5v regulator.
socket. The display organisation is 24 lines of 3 2 characters T V standard
per line showing black characters on a white screen. The Z X 8 0 The Z X 8 0 is designed to work with U H F TVs (channel 36)and
does not connect to a printer. is the version required for use in the United Kingdom. The
Programming Z X 8 0 USA is designed to work with a V H F TV<American
Programs can be entered on the keyboard or loaded from channel 2. European channel 3) and is the version required for
cassette. The Z X 8 0 has automatic "wrap round" so lines of the American T V system, also for countries without U H F ,
program can be any length but not multi-statement lines.
ZX81
Syntax check
The syntax of the entered line is checked character by char-
acter. A syntax error cursor marks the first place the syntax
breaks down if there is an error. Once any errors have been
Dimensions
edited out the syntax error cursor disappears. Only syntax
Width 167mm (6.32 in)
error free lines of code are accepted by the Z X 8 0 .
Depth 175mm (6.80 in)
Graphics
Height 4 0 mm (1.57 in)
Total of 22 graphics symbols giving 4 8 x 64 pixels resolution
Weight 350 gms (12.15 oz)
consisting of 10 symbols plus space and inverses. Includes
symbols for drawing bar charts. Under control of your BASIC
Microprocessor/Memory
program any character can be printed in reverse field.
Z 8 0 A 3.25 MHz clock
Editing
ROM: Containing 8K BASIC interpreter
The line edit allows you to edit any line of program or input
including statement numbers. The edit and cursor control RAM: 1K bytes internal, externally expandable to 16K bytes.
keys are E D I T , R U B O U T , H O M E .
Arithmetic Keyboard
Arithmetic operators + , - , x , exponentiate. Relational oper-
4 0 key touch-sensitive membrane. Using function mode and
ators < , > , = , yielding 0 or — 1. Logical operators A N D OR
single press key-word system, this gives the equivalent of 91
NOT yielding boolean result. Relational operators also apply to
keys and also graphics mode allows an additional 20 graphical
strinqs. Z X 8 0 BASIC uses 16 bit two's complement
and 54 inverse video characters to be entered directly.
arithmetic ( + 32767 ).
Display
Variables
Requires an ordinary domestic black and white or colour T V .
Numeric variable names may be any length, must begin with a
The aerial lead supplied connects the Z X 8 1 to the T V aerial
letter and consist of alphanumerics. Every character in the name
is compared thus an infinity of unique names is available. socket. The display is organised as 24 lines of 32 characters
String variables may be assigned to or from, shortened but not with black characters on a white background.
concatenated. String variable names are AS — ZS. Strings do not Two mode speeds
require a dimension statement and can be any length. The Z X 8 1 can operate in two software selectable modes FAST
Arrays have a maximum dimension of 255 (256 elements) each. and N O R M A L . FAST is ideal for really high-speed computing.
Array names consist of a single letter A - Z . In N O R M A L mode however the Z X 8 1 allows continuously
Control variable names in FOR. . . N E X T loops consist of a moving, flicker free animated displays
single letter A—Z. Printer
The 8K ROM will permit instructions ( L P R I N T . LLIST and
Expression evaluator COPY) to drive the Sinclair Z X Printer
The full expression evaluator is called whenever a constant or Programming
variable is encountered during program execution. This allows Programs can be entered via the keyboard or loaded from cass-
you to use expressions in place of constants especially useful in ette. Programs and data can be saved onto cassette so that they
GOTOs, GOSUBs, F O R . . . N E X T etc.
128 ZX C O M P U T I N G S U M M E R 1982
Specifications
are not lost when the Z X 8 1 is turned off. Arrays
Syntax check
The syntax of a tine of program is checked on entry. A syntax Arrays may be multi dimensional with subscripts starting at 1,
error cursor marks the first place the syntax breaks down if
there is an error. The syntax error cursor disappears when errors Expression evaluator
have been corrected. Only lines free from syntax errors will be The full expression evaluator is called whenever an expression,
entered into the program. constant or variable is encountered during program execution.
Graphics This powerful feature allows use of expressions in place of
Apart from the 20 graphics characters, space and its inverse, the constants and is especially useful in G O T O , GOSUB etc.
display may also be divided into 64 x 44 pixels, each of which Command mode
may be 'blacked' in or 'whited' out under program control. The Z X 8 1 will execute statements immediately, enabling it to
Editing perform like a calculator.
A line editor allows you to edit any line of program or input, Cassette interface
including program line numbers. Lines may be deleted, in- Works using domestic cassette recorders. The transfer rate is
creased or decreased in size. 250 baud and uses a unique recording format not compatible
Arithmetic with other systems. The Z X 8 1 will save the data as well as
Arithmetic operators +, —, x, , exponentiate. Relational oper the program to avoid the need to re-enter the data when the
ators =, < > , > , < , < = , > = , may compare string and arithmetic program is next loaded.
variables to yeild 0 (False) or 1{True). Logical operators A N D , Z X 8 1 will search through a tape for the required program).
OR, NOT yield boolean results. The cassette leads supplied have 3.5 mm jack plugs.
Floating-point numbers Expansion port
Numbers are stored in 5 bytes in floating-point binary form At the rear, this has the full data, address and control buses
giving a range of i 3 x 10 ' " t o i 7 x 10 "accurate to 9V4 from the Z 8 0 A CPU as well as O V , + 5 V , + 9 V , 0 and the mem-
decimal digits. ory'select lines. These signals enable you to interface the Z X 8 1
Scientific functions to the Sinclair 16K R A M pack and ZX printer.
Natural logs/antilogs; SIN, COS, T A N and their inverses;SQR; Power supply
e*. The Z X 8 1 requires approximately 4 2 0 m A at 7 - 1 I V DC. It has
Variables its own internal 5V regulator. The ready assembled Z X 8 1 comes
Numerical: any letter followed by alphanumerics complete with a power supply. The Z X 8 1 kit does not include
String: A* to Zi a power supply.
FOR N E X T loops: A - Z (loops may be nested to any TV standard
depth. The Z X 8 1 is designed to work with U H F TVs (channel 36) 625
Numerical arrays: A—Z lines.
String arrays: Ai to Zi
ZX C O M P U T I N G S U M M E R 1982 129
A
FULLER FD SYSTEM FOR ZX80/81-x
THE MOST VERSATILE SYSTEM FOR EXPANDING YOUR ZX
Built keyboard and case £39.95 or kit £33.95 plus £2.50 postage
and packing. Motherboards £15.95 plus 80p postage and packing.
16k RAM board £35.95. 64k RAM board £79.95.
a must f o r
17-111 W+A
Authors: Ian S t e w a r t ft Robin Jones
The reader-friendly guide to getting started w i t h the
Sinclair Z X 8 1 . Includes an introduction to looping and
branching, graphics, subroutines, and debugging
techniques, w i t h over 5 0 programs designed to run
on the standard 1K memory.
I ) GETTING ACQUAINTED WITH YOUR ZX81 - by Tim Hartnell - £5.95 This great ZX81 book contains
over 80 programs in its 128 pages. Takes you from the first steps of programming your ZX81 to quite com
plex programs such as WORD PROCESSOR, DRAUGHTS and LIFE. You'll find a host of programs to get
your ZX81 up and running with worthwhile programs, right from day one. Other programs include SPACE
BOY, ROLLER-BALL, CHEMIN DE FER, GRAFFITI, MICRO-MOUSE, POGO, TOWERS OF HANOI,
BLOCKOUT, SALVADOR, BANDIT and DODGE CITY.
As well as programs, there are sections to explain the use of PLOT, UNPLOT, PRINT AT, MAKING THE
MOST OF 1K, ARRAYS, WRITING PROGRAMS, BIO-RHYTHMS, ARCADE GAMES. RANDOM
NUMBERS, PEEK AND POKE, HOW TO CONVERT PROGRAMS, USEFUL ADDRESSES, SPECIFICA
TIONS, THE NEW ROM.
) THE GATEWAY GUIDE TO THE ZX81 AND ZX80 - by Mark Charlton - £6.45 Explains ZX BASIC from
first principles. 180 pages, more than 70 programs. Recommended by Creative Computing
) MASTERING MACHINE CODE ON YOUR ZX81 OR ZX80 - by Tony Baker - £7.50 Warmly welcomed
by the computer press, this book has continued to attract praise, because it does exactly what it claims to
do in the title.
) 49 EXPLOSIVE GAMES FOR THE ZX81 (and 29 for the ZX80) - edited by Tim Hartnell - £5.95 Every
game you need: DRAUGHTS, GALACTIC INTRUDERS, STAR TREK, DEATH MAZE, 4-IN-A-ROW and
an 8K ADVENTURE-type program SMUGGLERS BOLD.
) 34 AMAZING GAMES FOR THE 1K ZX81 - by Alastair Gourlay - £4.95 All programs dumped from the
printer and guaranteed to run. This book is the key to making the most of 1K.
> GETTING ACQUAINTED WITH YOUR VIC20 - by Tim Hartnell - £6.95 This book is the ideal one for
first-time users of the VIC 20, with over 60 programs.
) SYMPHONY FOR A MELANCHOLY COMPUTER and other programs for the VIC20 - £6.95 A great col-
lection of 24 great games - all dumped direct from the printer - for the VIC20.
) GETTING ACQUAINTED WITH YOUR ACORN ATOM - by Trevor Sharpies and Tim Hartnell - £7.95
) 39 TESTED PROGRAMS FOR THE ACORN ATOM (the best of INTERFACE) - £6.45
INTERFACE,
44-46, Earls C o u r t Road, D e p a r t m e n t ZC, L o n d o n W 8 6EJ.
Name
Address
Q8 D E F E N D E R . Q8 INVADERS. Q8 A S T E R O I D S
trp DOWN THRUST-FIRE LEFT RIGHT FIRE LEFT RIGHT THRUST FIRE
First and onJy ftill screen display 13x7 INVADERS; High score; 3 Software to drive QS SOUND BD
Software to drive QS SOUND BD levels of play. RND saucers; Bonus Multiple missiles firing in 8
Moving Planetary surface. Up to base. Drives Sound bd fifCHRS bd directions On screen scoring
84 fast moving characters on Requi res 7K RAM. 8K ROM v Slow Increasing number of asteroids
screen at once On screen scoring 4B.80. Full mobility of ship to all areas of
Ten missiles at once Increasing the screen Two asteroid sizes
attack patterns Requires 8K Bonus ship at 10,000 points
ROM. and 4K mln of RAM £>5.50. Requires 8K ROM. 4Kmin of RAM
+ SLOW function A8.BO.
Q6 S O U N D BD. Q8 3 K R A M Bd.
A programmable sound effects An extremely reliable static RAM
board using the AY-3-8910 3 Bd which combines with the
TONES. 1 NOISE, ENVELOPE computer's memory to give 4K
SHAPE R • TWO 8 BIT I/O PORTS total Plugs direct in to the rear
Easily programmable from port on your ZX Computer
BASIC, the A Y chip does most of £18.00.
the work leaving your computer
free for other things Signal 0/P QB M O T H E R B O A R D BD. & Q8
via 3 6 mm Jack socket Ports 0/P CONNECTOR.
via a 16 pin I.C Socket A86.00. A reliable expansion system
allowing a total of any RAM pack
Q8 H I R E S BD. plus twoother plug in boards to be
Q8CHBSBD./
A Hi - res graphics board g: /ing in use at once On board SV
A programmable character
256 x 192 PIXELS 6K ON BD regulator drives all external
generator givmg 128 SEP- boards Fitted with two 23 way
RAM SOFTWARE SELECT/
ARATELY PROGRAMMABLE double sided edge connectors
DESELECT MIXED TEXT AND
CHARACTERS ON/OFF .TWITCH Connector is 2 x 23 way edge
GRAPHICS 2K ON BOARD ROM
IK ON BOARD RAM Enables conns soldered back to back
Resident fast machine code
creation and display of your own graphics software ( i n ROM) Expansion can operate in two
characters to screen or printer provides the following HI RES ways - < 1 ) COMPUTER —
Demo cassette of fast machine Commands MOVE x.y. PLOTx. CONNECTOR — Any QS add on bd
code operation routines and lower y. DRAW x.y; BOX x.y, UP, DOWN (but no extra RAM pack > ( 2 )
case alphabet included See below LEFT. RIGHT. PRINT A « , SCROLL; COMPUTER — CONNECTOR
for ZX PRINTER listing A 2 6 . 0 0 . BLACK. WHITE CLEAR COPY See MOTHER BD — ANY RAM PACK
Q 5 - LOUCR c«se above for ZX PRINTER listings ( 2 b d s t o f l t m mother bd 1 Mother
i b cd « « 9 h • j t n i n o M r n u v u x ^ i using COPY £ 8 5 . 0 0 . board A 1 a.OOConnector A4.00.