' This program exported from BASIC Anywhere Machine (Version [5.2.3].[2024.09.09.00.00]) on 2024.10.19 at 18:07 (Coordinated Universal Time)
' Program by Charlie Veniot to demonstrate the GET and PUT graphics statements and the PUT "Methods": PSET, PRESET, AND, OR, XOR
' Also demonstrating SCROLL

DIM s%( 450 ) ' 30x30 pixels = 900; 900 pixels x 4 bits per pixel = 3600 pixels, so we need 450 bytes of memory space needed
CONST xi%(1 TO 5) = {-4, -3, -1, 1, 3}

SCREEN _newimage(482,210,7)

FOR i% = 0 TO 28 step 2
    LINE ( 0, i% ) - ( 28 - i%/2, i% + 1 ), i%/2 + 1, B
NEXT i%

GET ( 0, 0 ) - ( 29, 29 ), s%

FOR c% = 0 TO 15
    LINE ( c% * 30, 30 ) - ( c% * 30 + 30, 299 ), c% + j%, BF
    x% = c% * 30
    PUT ( x%, 35 ), s%, PSET
    PUT ( x%, 70 ), s%, PRESET
    PUT ( x%, 105 ), s%, AND
    PUT ( x%, 140 ), s%, OR
    PUT ( x%, 175 ), s%, XOR
NEXT c%

ALERT("When you are done viewing the static image, click the screen to start animating the screen.")
SLEEP

DO
    c% =  INT( RND * 16 )
    x% =  0
    FOR y% = 35 TO 175 STEP 35
        SCROLL (x%, y%) - ( 479 , y% + 29 ), xi%(y%/35), 1, TRUE
    NEXT y%
    sleep 0.001
LOOP