AMSTRAD CPC464 User Manual page 41

Cpc464 colour personal computer 64k
Hide thumbs Also See for CPC464:
Table of Contents

Advertisement

In mode 0, there are only 20 columns, but the same 25 lines. If you now type in:
mode 0
run
You will see that the man now appears at the top right corner of the screen. This happens because
the x co-ordinate 20, is the last column in mode 0.
In mode 2, there are 80 columns and 25 lines. Using the same program, you will probably be able to
guess where the man will appear. Type in:
mode 2
run
return to mode 1 by typing in:
mode 1
Now experiment for yourself, modifying the locate and chr$( ) numbers to position various characters
anywhere on the screen. Just for example, type in:
L o c a t e 2 0 , 1 2 : p r i n t c h r $ ( 2 4 0 )
You will see an arrow in the centre of the screen. Note that in this instruction
20 was the horizontal (x) co-ordinate (in the range 1 to 40)
12 was the vertical (y) co-ordinate (in the range 1 to 25)
240 was the character symbol number (in the range 32 to 255)
To get the character symbol 250 to be repeated across the screen, type in the following program:
5 cls
1 0 f o r x = 1 t o 3 9
2 0 L o c a t e x , 2 0
4 0 p r i n t c h r $ ( 2 5 0 )
5 0 n e x t x
6 0 g o t o 5
run
Press [ESC] key twice to break
In order to remove the previous character from the screen before printing the next character, type in:
4 0 p r i n t " " ; c h r $ ( 2 5 0 )
(This new line 40 automatically replaces the line previously typed as line 40.)

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents