Write language name in 3D ASCII: Difference between revisions
Content added Content deleted
(→{{header|Kotlin}}: Updated example see https://github.com/dkandalov/rosettacode-kotlin for details) |
m (→{{header|ZX Spectrum Basic}}: fixed the first example) |
||
Line 386: | Line 386: | ||
to cause a colour switch using a traditional space (ascii 32), |
to cause a colour switch using a traditional space (ascii 32), |
||
but the output would still look the same. |
but the output would still look the same. |
||
Fixed the error and removed the need for 2^z. |
|||
<lang zxbasic>10 |
<lang zxbasic> 10 DIM b(5,5): REM our bigmap characters |
||
20 |
20 FOR l=1 TO 5: REM 5 characters |
||
30 FOR |
30 FOR m=1 TO 5: REM 5 rows |
||
40 READ b(m,l) |
|||
40 FOR m = 1 TO 5: REM 5 rows |
|||
50 |
50 NEXT m |
||
60 NEXT |
60 NEXT l |
||
⚫ | |||
⚫ | |||
80 INK 2: REM our shadow will be red |
|||
⚫ | |||
⚫ | |||
100 LET r=8: REM shadow will start on row 8 |
|||
⚫ | |||
⚫ | |||
120 GO SUB 2000: REM draw shadow |
|||
130 INK 6: REM our foreground will be yellow |
|||
⚫ | |||
⚫ | |||
150 LET c=2: REM foreground will start on column 2 |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
190 GO SUB 2000: REM display the language name |
|||
⚫ | |||
1000 REM convert to binary bigmap |
1000 REM convert to binary bigmap |
||
1010 LET |
1010 LET z=16 |
||
⚫ | |||
1020 LET g$="": REM this will contain our 5 character binary bigmap |
|||
1040 |
1040 LET c1=c1+1: LET z=z/2 |
||
1050 IF z>=1 THEN GO TO 1020 |
|||
1050 LET d$=" ": REM assume next digit is zero (draw a space) |
|||
⚫ | |||
⚫ | |||
1070 LET g$=g$+d$ |
|||
1080 NEXT z |
|||
⚫ | |||
2000 REM display the big letters |
2000 REM display the big letters |
||
2010 FOR l=1 TO 5: REM our 5 rows |
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 |
2030 FOR m=1 TO 5: REM bigmap for each character |
||
2040 LET |
2040 LET t=b(l,m) |
||
2050 GO SUB 1000 |
2050 GO SUB 1000 |
||
2060 PRINT |
2060 LET c1=c1+1: REM PRINT " ";: REM space between each letter |
||
⚫ | |||
2070 PRINT " ";: REM space between each letter |
|||
2080 NEXT |
2080 NEXT l |
||
2090 |
2090 RETURN |
||
2100 RETURN |
|||
9000 DATA 30,17,30,17,30: REM B |
9000 DATA 30,17,30,17,30: REM B |
||
9010 DATA 14,17,31,17,17: REM A |
9010 DATA 14,17,31,17,17: REM A |