' This program exported from BASIC Anywhere Machine (Version [5.2.3].[2026.05.16.03.15]) on 2026.06.09 at 02:54 (Coordinated Universal Time)
' This program by Charlie Veniot
' based on the graphic output of a BBC-BASIC-for-SDL program by Kurt Moerman
' shared with the "BASIC Programming Language" Facebook group
' Kurt Moerman's code can be found at https://github.com/oonap0oo/BBC-BASIC-for-SDL/blob/main/cafe_wall_illusion.bas

ALERT( "Pause the program at any time by clicking/touching the screen, and holding that click/touch the screen.\n\n" + _
       "The proram will resume when you relesase the click/touch.")
       
SCREEN _NEWIMAGE( 301, 181, 17 )
FOR i% = 1 TO 14
    COLOR 7
    LINE ( i% * 20, 0 ) TO ( i% * 20, 180 )
    IF i% < 11 THEN LINE ( 20, ( i% - 1 ) * 20 ) TO ( 280, ( i% - 1) * 20 ), , B
NEXT i%

PAINT ( 0, 0 ), 56, 7 : PAINT ( XMAX, 0 ), 56, 7
FOR x% = 2 TO 12 STEP 2
    FOR y% = 0 TO 8
        PAINT( x% * 20 + 2, y% * 20 + 2), 63, 7
NEXT y%, x%

i% = 0
dir% = + 1

AnimationLoopStart:

  IF ABS( i% ) > 10 THEN dir% = - dir% : sleep 2
  WHILE _MOUSEBUTTON : WEND
  SLEEP 0.1
  FOR y% = 0 TO 160 STEP 40
      SCROLL (0, y% ) TO ( XMAX,y% + 19 ), IFF( y% MOD 80 = 0, dir%, -dir%), 0, TRUE
  NEXT y%
  i% = i% + dir%
  
GOTO AnimationLoopStart