20.02.2013 Views

ZX Computings - OpenLibra

ZX Computings - OpenLibra

ZX Computings - OpenLibra

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

a<br />

ie<br />

real-<br />

ing<br />

hold<br />

nd<br />

:ase<br />

he<br />

d 510<br />

t<br />

date Y<br />

he<br />

of<br />

its<br />

RKS<br />

Lines 700-706:<br />

Line 710:<br />

Lines 735-780:<br />

Lines 790-840:<br />

Line 999:<br />

PRINT the fourth "question" down the right<br />

hand side of the screen,<br />

waits until a letter(s) are entered. Line 715<br />

causes the program to jump to line 730 if a<br />

"Y" is entered. If an "N" is entered then the<br />

program STOPs, otherwise the program<br />

waits at the INPUT statement at line 710.<br />

display the fifth "question" and wait for a<br />

proper INPUT at line 775.<br />

execute the various subroutines,<br />

causes the program to halt. Equivalent to an<br />

END statement.<br />

SUBROUTINE AT LINE 1000:<br />

"btacks-in" the left % of the screen.<br />

Line 1010 contains 23 inverse spaces.<br />

Line 1025 puts the sun (an inverse asterisk)<br />

in the centre of the black square.<br />

SUBROUTINE AT LINE 1 050:<br />

displays the planets in their starting<br />

positions.<br />

SUBROUTINE AT LINE 1 100:<br />

displays the period.<br />

SUBROUTINE AT LINE 1145:<br />

removes any print statements on the righthand<br />

side by PRINTing blank tines. Nine<br />

spaces are contained in the string in tine<br />

1155.<br />

IMER 1982 <strong>ZX</strong> COMPUTING SUMMER 1982<br />

<strong>ZX</strong>81 Programs<br />

SUBROUTINES AT LINES 1 495, 1 595, 1 695 and 1 795:<br />

contain the different pieces of data on each<br />

of the four planets.<br />

SUBROUTINE AT LINE 1995:<br />

PRINTs the general headings for the data.<br />

SUBROUTINE AT LINE 2100:<br />

converts plot co-ordinates to PRINT AT coordinates<br />

and then displays each planet's<br />

initial letter by the pixel square representing it<br />

on the display.<br />

Line 2145 contains an inverse "H".<br />

Line 21 50 contains an inverse "V".<br />

Line 2155 contains an inverse "E".<br />

Line 21 60 contains an inverse "M".<br />

The Display<br />

(a) PRINT AT co-ordinates:<br />

The <strong>ZX</strong>81 PRINT AT statement<br />

is of the form — 9999<br />

PRINT AT (line), (column);<br />

"{whatever is to be<br />

•PRINTed)" - where:<br />

line numbers are from 0 to<br />

21 inclusive.<br />

column numbers are from 0<br />

to 31 inclusive.<br />

(b) PLOT/UNPLOT co-ordinates:<br />

The <strong>ZX</strong>81 PLOT/UNPLOT<br />

statements are of the form<br />

- 9999 PLOT (X pixel<br />

coord), (Y pixel coord) . . .<br />

"blacks-in" pixel<br />

9999 UNPLOT (X pixel<br />

coord), (Y pixel coord) . . .<br />

"whites-out" pixel —<br />

where:<br />

X coords are from 0 to 63 inclusive<br />

Y coords are from 0 to 43 inclusive<br />

Normally, the <strong>ZX</strong>81 prints<br />

BLACK ON WHITE. During the<br />

simulation, the first 23 columns<br />

(down all 22 lines) are<br />

"blacked-in" (Line 1010).<br />

So that the planets and sun<br />

can be seen on the bfack back-<br />

Space Saving<br />

tf the program IS to be used as<br />

part of some space-borne<br />

adventure game then its length<br />

will undoubtedly want to be<br />

shortened. I suggest the following<br />

course of action:<br />

1. Remove the REM statements.<br />

2. Remove the introduction<br />

and the first THREE "questions".<br />

3. Replace the INPUT statements<br />

for the three "questions"<br />

by LETs.<br />

ground an UNPLOT statement<br />

DISPLAYS the planet, whilst a<br />

PLOT statement will "btack-in"<br />

the square again. If your computer<br />

normally writes WHITE<br />

ON BLACK then it may be found<br />

better to make the right hand<br />

side of your screen WHITE with<br />

your inverse spaces. If you do<br />

so remember to change all<br />

writing in PRINT statements<br />

after tine 620 to your inverse<br />

graphics, delete lines 1000,<br />

1005, 1010 and 1015, and<br />

change the characters in lines<br />

1025,2145,2150,2155and<br />

2160 to your "normal" and<br />

NOT inverse characters.<br />

It may have been noticed<br />

that in lines 560-575 and 590-<br />

605 the Y coords are being<br />

deducted from 44 (The<br />

greatest Y pixel coord). This<br />

causes the planets to revolve<br />

ANTICLOCKWISE about the<br />

sun. If the "44-" is omitted<br />

th en the planets revolve<br />

CLOCKWISE. All PRINT AT,<br />

PLOT/UNPLOT statements are<br />

referenced to the top LEFT-<br />

HAND corner of the screen.<br />

4. Put variables AH, AV, AE,<br />

AM, SXH & SYH, SXV &<br />

SYV, SXE & SYE, SXM &<br />

SYM, RH, RV, RE and RM into<br />

their respective routines.<br />

(5. Reduce the number of<br />

planets.)<br />

Again there is no reason why<br />

the planets should be called<br />

Mercury, Venus or whatever.<br />

The program was written in a<br />

"modular" form to aid conversion<br />

but this does make it rather<br />

lengthy.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!