Someone has asked me for the code that produces the coloured ASCII heading in GOLIATH, like this:
Well, it is here:
MODE 10
*font Courier New, 14
PROC_3dname( " HELLO", 6, 4 )
PROC_3dname( " WORLD", 6, 4 )
END
DEF PROC_3dname(name$, col%, bcol%)
REM produces 3d text in ascii graphics
REM NOTE: uses ASCII characters 255, 254
REM
REM modified from:
REM http://rosettacode.org/wiki/Write_language_name_in_3D_ASCII#BBC_BASIC
REM by Richard Russell
LOCAL A%, X%, Y%, char%, row%, patt%, bit%
DIM X% 8 : A% = 10 : Y% = X% DIV 256
VDU 23,255,255,255,255,255,255,255,255,255
COLOUR bcol%
*refresh off
FOR row% = 1 TO 8
FOR char% = 1 TO LEN(name$)
?X% = ASCMID$(name$,char%)
CALL &FFF1
patt% = X%?row%
FOR bit% = 7 TO 0 STEP -1
VDU23,254,RND(128),RND(128),RND(128),RND(128),RND(128),RND(128),RND(128),RND(128)
CASE TRUE OF
WHEN (patt% AND 2^bit%) <> 0 :COLOUR col%: PRINTCHR$(255);
WHEN GET$(POS-1,VPOS-1) = CHR$(255): COLOUR bcol%: PRINTCHR$(254);
OTHERWISE: PRINT " ";
ENDCASE
NEXT
NEXT char%
PRINT
NEXT row%
*refresh on
ENDPROC
Subscribe to:
Post Comments (Atom)