Page 1 of 3

X and Y

Posted: Sat Jun 15, 2019 11:31 pm
by Crayon21
When using the plot and draw commands, I get confused as to what X and Y symbolize as far as cardinal direction.
Is X up and Y left, is the second number a completely different direction? Is there some sort of guide i can use to map out the Plot and Draw commands. In short, do i need to know geometry to do simple commands? Clearly, Sinclair never thought that we'd need a map just to make a simple picture. I can understand Circle fine, but even making a simple face is frustrating. please help

BTW, how do i save drawings as Jpeg or other using Fuse?

Re: X and Y

Posted: Sun Jun 16, 2019 2:03 am
by 1024MAK
In terms of graphics, imagine you are looking at a piece of graph paper (with a fine grid printed on it).

X is then the horizontal plane, with point zero on the bottom left, and as you move to the right, X increments upwards.

Y is the vertical plane. Point zero is still the bottom left. As you move up, Y increases.

This is a completely different system to the PRINT AT coordinate system.

See the manual for more details...

Mark

Re: X and Y

Posted: Sun Jun 16, 2019 9:50 am
by Crayon21
and for PRINT AT?

Re: X and Y

Posted: Sun Jun 16, 2019 12:22 pm
by 1024MAK
PRINT AT line, column

E.g.
PRINT AT 11,15;”Hi”
will print Hi in the middle of the screen.

PRINT AT 0,0;
will set the current print position to the top left corner.

PRINT AT is shown in the manual here.

Mark

Re: X and Y

Posted: Tue Jun 18, 2019 5:01 am
by XavSnap
Hi,

I had to diet a Spectrum program, to add a display routine in it.
I had to delete all "PRINT AT" to retrieve memory rooms…

http://zx81.ordi5.free.fr/sacha/downloa ... _ATOME.zip

I just use the specials display characters:
Print AT 14,15 ( 1+7+1+7= 16 bytes) (+4 bytes if you had to cut a text line: ";AT 14,15;" )
\{22}\{14}\{15} (3 bytes)
Where \{22}=CHR$(22) \{14}=Y AND \{15}=X

SCpos$=CHR$(22) +CHR$(14)+ CHR$(15) >> Print AT 14,15;"HELLO WORLD" ==PRINT SCpos$;"HELLO WORLD"

But, you can't replace all AT functions in the main Basic Editor. You had to run my updated "ZmakeBas" release !
It able to add binaries in texts.

"ZmakeBas" and examples enclosed in the "Galagor" zipped file.
:ugeek:

Re: X and Y

Posted: Wed Jun 19, 2019 2:31 am
by Crayon21
Is there some sort of Graph Paper reference as far as direction.

10,10 is center and 0,0 is top left, what direction or placement are the others? :?:

Re: X and Y

Posted: Wed Jun 19, 2019 3:03 am
by XavSnap
1024MAK wrote: Sun Jun 16, 2019 12:22 pm PRINT AT is shown in the manual here.
??? Arrhg … the famous "Have a look to the fucking manual"...
what direction or placement are the others?
Elementary my dear Watson: all around the center !

Re: X and Y

Posted: Wed Jun 19, 2019 5:19 pm
by 1024MAK
Try...

Code: Select all

10 CLS
20 FOR C=0 TO 31 STEP 8
30 FOR L=0 TO 21
40 PRINT AT L,C;L;“ ”;C
50 NEXT L
60 NEXT C
70 PAUSE 4E4
[Works on both the ZX Spectrum and the ZX81, but the Zeddy takes a bit longer...]

Mark

Re: X and Y

Posted: Wed Jun 19, 2019 6:02 pm
by 1024MAK
Also try...
[ZX Spectrum version]

Code: Select all

10 FOR A=0 TO 1 STEP 0
20 CLS
30 INPUT “Line number? ”;L
40 INPUT “Column number? ”;C
50 PRINT AT L,C;”O”
60 PAUSE 4E4
70 NEXT A
[ZX81 version]

Code: Select all

10 FOR A=0 TO 1 STEP 0
20 CLS
30 PRINT AT 21,0;“LINE NUMBER”
40 INPUT L
50 PRINT AT 21,0;“COLUMN NUMBER”
60 INPUT C
70 CLS
80 PRINT AT L,C;”O”
90 PAUSE 4E4
100 NEXT A
With both, type the keyword STOP in the input line to stop.

Mark

Re: X and Y

Posted: Fri Jun 21, 2019 12:16 am
by Crayon21
what are all the numbers for? positions? kinda lost here