Write language name in 3D ASCII: Difference between revisions

m
→‎{{header|ZX Spectrum Basic}}: fixed the first example
(→‎{{header|Kotlin}}: Updated example see https://github.com/dkandalov/rosettacode-kotlin for details)
m (→‎{{header|ZX Spectrum Basic}}: fixed the first example)
Line 386:
to cause a colour switch using a traditional space (ascii 32),
but the output would still look the same.
Fixed the error and removed the need for 2^z.
 
<lang zxbasic> 10 LETDIM s$="BASIC"b(5,5): REM our languagebigmap namecharacters
20 DIMFOR l=1 TO b(5,5): REM our bigmap5 characters
30 FOR l m= 1 TO 5: REM 5 charactersrows
40 READ b(m,l)
40 FOR m = 1 TO 5: REM 5 rows
50 READNEXT b(l,m)
60 NEXT ml
100 70 PAPER 0: BORDER 0: REM black background and border
70 NEXT l
80 INK 2: REM our shadow will be red
 
120 90 CLS
100 PAPER 0: REM black background
110 100 INKLET 2r=8: REM our shadow will bestart on row red8
180 110 LET c=31: REM foregroundshadow will start onat column 31
120 CLS
130 120 LETGO r=9SUB 2000: REM draw shadow will start on row 5
140 130 LETINK c=26: REM shadowour foreground will start at columnbe 2yellow
170 140 LET r=109: REM foreground will start on row 69
150 GO SUB 2000: REM draw shadow
160 150 INKLET 6c=2: REM our forgroundforeground will bestart on column yellow2
150 160 GO SUB 2000: REM drawdisplay shadowthe language name
170 LET r=10: REM foreground will start on row 6
999 STOP
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 tz=n: REM temporary variable16
10601020 IF t>=(2^z) THEN LETPRINT AT d$=r+l-1,c+c1;CHR$ (143);: LET t=t-(2^z): LET sf=1: REM 143 is a block
1020 LET g$="": REM this will contain our 5 character binary bigmap
1040 FORLET zc1=5c1+1: TOLET 0 STEP -1z=z/2
1050 IF z>=1 THEN GO TO 1020
1050 LET d$=" ": REM assume next digit is zero (draw a space)
10901060 RETURN
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: LET c1=0: REM our 5 rows
2020 PRINT AT r+l-1,c;
2030 FOR m=1 TO 5: REM bigmap for each character
2040 LET nt=b(l,m)
2050 GO SUB 1000
2060 LET c1=c1+1: REM PRINT g$" ";: REM 5space between charactereach bigmapletter
702070 NEXT lm
2070 PRINT " ";: REM space between each letter
2080 NEXT ml
2090 NEXT lRETURN
2100 RETURN
 
9000 DATA 30,17,30,17,30: REM B
9010 DATA 14,17,31,17,17: REM A
457

edits