_alert("Click on (or touch) the screen to get a new random tessellation.")

FUNCTION defPixel$()
  defPixel$ = "."
  IF INT(RND*2) = 1 THEN defPixel$ = "X"
END FUNCTION

'🔸🔸🔸  Main Program

  SCREEN _NEWIMAGE(160, 112, 14)

  DO

      CLS: COLOR INT(RND*64) + 1 : PRINT
      GOSUB 🎲CreateGraphicsChars
      GOSUB ✅PrintTiles
      GOSUB ⌛WaitForClickUnclick

  LOOP

  END

'🔸🔸🔸 Subroutines

  🎲CreateGraphicsChars: 
        c$ = "" : d$ = ""
        FOR i = 1 TO 64
            p$ = defPixel$()
            c$ = c$ + p$
            d$ = p$ + d$
        NEXT i
        _LETCHR$(0, c$) : _LETCHR$(1, d$)
    RETURN

  ✅PrintTiles:
        ptrn% = INT(RND*3) 
        FOR i = 1 TO 80
            SELECT CASE ptrn%
              CASE 0
                PRINT CHR$(0) + CHR$(0) + CHR$(1);
              CASE 1
                PRINT CHR$(0) + CHR$(1) + CHR$(0);
              CASE 2
                PRINT CHR$(1) + CHR$(0) + CHR$(0);
            END SELECT
        NEXT i
    RETURN

  ⌛WaitForClickUnclick:
        WHILE NOT _MOUSEBUTTON : WEND
        WHILE _MOUSEBUTTON : WEND
    RETURN