diff --git a/Applications/ANSI/ansi.png b/Applications/ANSI/ansi.png index 133d199..a715789 100644 Binary files a/Applications/ANSI/ansi.png and b/Applications/ANSI/ansi.png differ diff --git a/Applications/ANSI/ansi_test.bas b/Applications/ANSI/ansi_test.bas index e07d396..edd0a5b 100644 --- a/Applications/ANSI/ansi_test.bas +++ b/Applications/ANSI/ansi_test.bas @@ -9,12 +9,29 @@ 90 REM Read the colour/effect name and if it is "END" 100 REM then stop 110 READ N$ -120 IF N$ = "END" THEN GOTO 200 +120 IF N$ = "END" THEN END 130 REM Read the colour/effect code 140 READ C$ -150 REM Print the colour/effect name using that effect -160 PRINT CHR$(27);"[";C$;"m";N$; -170 REM Clear colours and effects -180 PRINT CHR$(27);"[0m" -190 GOTO 90 -200 END +150 PRINT "" : PRINT "Code ";C$; " "; +160 REM Print the colour/effect name using that effect +170 GOSUB 330 +180 REM If this is an effect, rather than a colour, move +190 REM to the next one +200 LET C = VAL(C$) +210 IF C < 30 OR C > 37 THEN GOTO 90 +220 REM Output the "background" colour effect. Note that +230 REM the string conversion of the new code adds a leading +240 REM space that must be removed +250 LET C = C + 10 : LET C$ = STR$(C) +260 LET C$ = RIGHT$(C$, LEN(C$) - 1) +270 PRINT " ";C$;" "; : GOSUB 330 +280 REM Output the "bright foreground" effect +290 LET C = C + 50 : LET C$ = STR$(C) +300 LET C$ = RIGHT$(C$, LEN(C$) - 1) +310 PRINT " ";C$;" "; : GOSUB 330 +320 GOTO 90 +330 REM Output the current colour/effect +340 PRINT CHR$(27);"[";C$;"m";N$; +350 REM Clear all effects +360 PRINT CHR$(27);"[0m"; +370 RETURN