_TITLE "A 10PRINT Variant"
' This program exported from BASIC Anywhere Machine (Version [5.2.3].[2024.09.09.00.00]) on 2024.09.13 at 23:28 (Coordinated Universal Time)
' This program by Charlie Veniot is a port and mod
' of Ian Witham's C64 program (https://www.youtube.com/watch?v=ILnhj8TNiDc)

SCREEN _NEWIMAGE( 328, 200, 24 )

GOSUB 🟠SetupGraphicsChars

ALERT( "Click/touch the screen at any time to restart the program with new random colours." )

➔InitializeForNewDrawing:
    r% = INT( RND * 56 ) + 100
    g% = INT( RND * 56 ) + 100
    b% = INT( RND * 56 ) + 100
    hinc% = INT( RND * 101 )
    linc% = INT( RND * 101 )
    COLOR , _RGB( r%, g%, b% )
    CLS

➔DrawLoopStart:
    IF _MOUSEBUTTON THEN WHILE _MOUSEBUTTON : WEND : GOTO ➔InitializeForNewDrawing
    b% = IFF( b% = 0, 2, 0 )
    z% = INT( RND*2 )
    inc% = IFF( z% = 0, hinc%, - linc% )
    COLOR _RGB( r% + inc%, g% + inc%, b% + inc% )
    PRINT CHR$( z% + b% );
    SLEEP 0.01
GOTO ➔DrawLoopStart

END

🟠SetupGraphicsChars:
    LETCHR$( 0, _
        "XXXXXXXX" + _
        "XXXXXXX." + _
        "XXXXXX.." + _
        "XXXXX..." + _
        "XXXX...." + _
        "XXX....." + _
        "XX......" + _
        "X......." )
    LETCHR$( 1, _
        "XXXXXXXX" + _
        ".XXXXXXX" + _
        "..XXXXXX" + _
        "...XXXXX" + _
        "....XXXX" + _
        ".....XXX" + _
        "......XX" + _
        ".......X" )
    LETCHR$( 2, _
        ".......X" + _
        "......XX" + _
        ".....XXX" + _
        "....XXXX" + _
        "...XXXXX" + _
        "..XXXXXX" + _
        ".XXXXXXX" + _
        "XXXXXXXX" )
    LETCHR$( 3, _
        "X......." + _
        "XX......" + _
        "XXX....." + _
        "XXXX...." + _
        "XXXXX..." + _
        "XXXXXX.." + _
        "XXXXXXX." + _
        "XXXXXXXX" )
RETURN