Write language name in 3D ASCII: Difference between revisions

{{header|ZX Spectrum Basic}}
(graphics are not rquired for this task)
({{header|ZX Spectrum Basic}})
Line 29:
 
For the VRML script, see [http://nsg.upor.net/jpage/jpage.htm Andrew Nikitin's J page] (search for VRML) and for the origin of the 3D J banner, see [http://www.jsoftware.com/pipermail/programming/2007-May/006539.html Oleg Kobchenko's post to the J Forums].
 
=={{header|ZX Spectrum Basic}}==
 
We have used an extended (non ascii) character in this example to produce an inverted space symbol (143 on the spectrum character table), for simplicity. We could substitute another character, and change the handler to cause a colour switch using a traditional space, but the output would still look the same.
 
<lang basic>10 LET s$="BASIC": REM our language name
20 DIM b(5,5):REM our bigmap characters
30 FOR l = 1 TO 5: REM 5 characters
40 FOR m = 1 TO 5: REM 5 rows
50 READ b(l,m)
60 NEXT m
70 NEXT l
 
100 PAPER 0: REM black background
110 INK 2: REM our shadow will be red
120 CLS
130 LET r=9: REM shadow will start on row 5
140 LET c=2: REM shadow will start at column 2
150 GO SUB 2000: REM draw shadow
160 INK 6: REM our forground will be yellow
170 LET r=10: REM foreground will start on row 6
180 LET c=3: REM foreground will start on column 3
190 GO SUB 2000: REM display the language name
 
999 STOP
 
1000 REM convert to binary bigmap
1010 LET t=n: REM temporary variable
1020 LET g$="": REM this will contain our 5 character binary bigmap
1040 FOR z=5 TO 0 STEP -1
1050 LET d$=" ": REM assume next digit is zero (draw a space)
1060 IF t>=(2^z) THEN LET d$=CHR$(143): LET t=t-(2^z): LET sf=1: REM 143 is a block
1070 LET g$=g$+d$
1080 NEXT z
1090 RETURN
 
2000 REM display the big letters
2010 FOR l=1 TO 5: REM our 5 rows
2020 PRINT AT r+l-1,c;
2030 FOR m=1 TO 5: REM bigmap for each character
2040 LET n=b(l,m)
2050 GO SUB 1000
2060 PRINT g$;: REM 5 character bigmap
2070 PRINT " ";: REM space between each letter
2080 NEXT m
2090 NEXT l
2100 RETURN
 
9000 DATA 30,17,30,17,30: REM B
9010 DATA 14,17,31,17,17: REM A
9020 DATA 15,16,14,1,30: REM S
9030 DATA 31,4,4,4,31: REM I
9040 DATA 14,17,16,17,14: REM C
</lang>