AMSTRAD cpc 6128 User Instruction page 407

Integrated computer/disc system
Hide thumbs Also See for cpc 6128:
Table of Contents

Advertisement

1000 REM section to draw the screen
1010 IF LeveL=1 THEN RESTORE 2010
1020 IF LeveL=2 THEN RESTORE 2510
1030 IF LeveL=3 THEN RESTORE 3010
1040 FOR y=1 TO 25
1050 FOR x=1 TO 40
1060 READ char
1070 LOCATE x,y: PRINT CHR$(char);
1080 NEXT x,y
2000 REM DATA for screen 1
2010 DATA 200,190,244,244,210, ...... etc.
2500 REM DATA for screen 2
25 10 DATA 100, 1 03,245 , 243, 2 51 , ...... etc.
3000 REM DATA for screen 3
3010 DATA 190,191,192,193,194, ......
etc.
Another example use of D A TA, REA D and RES TOR E might be in a program that
plays a tune. Tone period values may be REA D from D A T A statements, and
RES TOR E used to make a section repeat by moving the pointer back to the beginning
of a certain part of the music data:
10 FOR i=1 TO 3
20 RESTORE 100
30 READ note
40 WHILE note<>-1
50 SOUND 1,note,35
60 READ note
70 WEND
80 NEXT
90 SOUND 1,142,100
100 DATA 95,95,142,127,119,106
110 DATA 95,95,119,95,95,119,95
120 DATA 95,142,1)9,142,179,119
130 DATA 142,142,106,119,127,-1
run
Chapter 9 Page 34
At your leisure ....

Advertisement

Table of Contents
loading

Table of Contents