Eight ways to drive a car [BASIC]

Anything Sinclair ZX Basic related; history, development, tips - differences between BASIC on the ZX80 and ZX81
Post Reply
User avatar
XavSnap
Posts: 1977
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Eight ways to drive a car [BASIC]

Post by XavSnap »

How to print a car, and scroll it to the right side...
Cap0000.jpg
Cap0000.jpg (2.39 KiB) Viewed 2074 times

PRINT AT:

Code: Select all

10 FOR A=0 TO 22
20 PRINT AT 10,A;" µµ««´±";AT 11,A;"  «««««««®";AT 12,A;" ¾‹OŒ´´‹OŒ"
30 NEXT A
TAB :

Code: Select all

10 FOR A=0 TO 22
20 PRINT AT 10,A;" µµ««´±";TAB A;"  «««««««®";TAB A;" ¾‹OŒ´´‹OŒ";
30 NEXT A
LET:

Code: Select all

1 DIM T$(3,64)
2 LET T$(1,32 TO)=" µµ««´±"
4 LET T$(2,32 TO)="  «««««««®"
6 LET T$(3,32 TO)=" ¾‹OŒ´´‹OŒ"
10 FOR A=33 TO 10 STEP -1
20 PRINT AT 10,0;T$(1,A TO )(TO 32);T$(2,A TO)(TO 32);T$(3,A TO)(TO 32);
30 NEXT A

Code: Select all

1 DIM T$(3,10)
2 LET T$(1)=" µµ««´±"
4 LET T$(2)="  «««««««®"
6 LET T$(3)=" ¾‹OŒ´´‹OŒ"
8 LET B$=""
10 FOR A=0 TO 22
20 PRINT AT 10,0;B$;T$(1)
30 PRINT B$;T$(2)
40 PRINT B$;T$(3)
50 LET B$=B$+" "
60 NEXT A

Code: Select all

1 DIM T$(3,32)
2 LET T$(1)=" µµ««´±"
4 LET T$(2)="  «««««««®"
6 LET T$(3)=" ¾‹OŒ´´‹OŒ"
10 FOR A=2 TO 23
20 LET T$(1,A TO)=T$(1,A-1 TO)
30 LET T$(2,A TO)=T$(2,A-1 TO) 
40 LET T$(3,A TO)=T$(3,A-1 TO)
50 PRINT AT 10,0;T$(1);T$(2);T$(3)
60 NEXT A

Code: Select all

1 DIM T$(3,32)
2 LET T$(1)=" µµ««´±"
4 LET T$(2)="  «««««««®"
6 LET T$(3)=" ¾‹OŒ´´‹OŒ"
10 FOR A=0 TO 21
20 LET T$(1)=T$(1,32)+T$(1)
30 LET T$(2)=T$(2,32)+T$(2)
40 LET T$(3)=T$(3,32)+T$(3)
50 PRINT AT 10,0;T$(1);T$(2);T$(3)
60 NEXT A

Code: Select all

1 DIM T$(3,32)
2 LET T$(1)=" µµ««´±"
4 LET T$(2)="  «««««««®"
6 LET T$(3)=" ¾‹OŒ´´‹OŒ"
10 FOR A=0 TO 21
20 LET T$(1)=" "+T$(1)
30 LET T$(2)=" "+T$(2)
40 LET T$(3)=" "+T$(3)
50 PRINT AT 10,0;T$(1);T$(2);T$(3)
60 NEXT A

Code: Select all

1 DIM T$(75)
2 LET T$(1 TO 10)= " µµ««´±"
4 LET T$(33 TO 43)="  «««««««®"
6 LET T$(65 TO 75)=" ¾‹OŒ´´‹OŒ"
10 FOR A=0 TO 22
20 PRINT AT 10,A;T$
30 NEXT A
But the simple and faster way to print this graphic bloc is to do PRINT AT with a 3 lines bloc... But use many memory room.
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
XavSnap
Posts: 1977
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: Eight ways to drive a car [BASIC]

Post by XavSnap »

Code: Select all

10 LET A$=" µµ««´±   «««««««®  ¾‹OŒ´´‹OŒ"
20 FOR A=0 TO 22
30 PRINT AT 10,A;A$(1 TO 9);AT 11,A;A$(10 TO 19);AT 12,A;A$(20 TO 29)
40 NEXT A
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
XavSnap
Posts: 1977
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: Eight ways to drive a car [BASIC]

Post by XavSnap »

ASM:

Code: Select all

1 REM [HEX:\
2A,16,40,23,23,46,23,4E,E5,CD,F5,08,E1,23,18,05,\
2A,16,40,23,23,7E,D6,1C,32,21,40,ED,5B,0E,40,4F,\
3E,21,91,4F,06,00,ED,43,7B,40,23,7E,FE,0B,28,0F,\
3A,21,40,4F,ED,B0,E5,2A,7B,40,19,EB,E1,18,EC,CD,\
5B,00 ]
10 FOR A=0 TO 22
20 PRINT AT 10,A;;USR 16530;"\
A\
 µµ««´±   \
  «««««««®\
 ¾‹OŒ´´‹OŒ"
25 IF A>5 THEN PRINT AT 11,A-6;USR 16530;"\
6\
  ¾½¾ \
 ¾½½½¿"
30 NEXT A
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Post Reply