Render a graphical pattern where each pixel is colored by the value of 'x xor y' from an arbitrary color table.

' version 03-11-2016
' compile with: fbc -s gui
 
Dim As ULong x, y, r, w = 256
 
ScreenRes w, w, 32
 
For x = 0 To w -1
    For y = 0 To w -1
        r =(x Xor y) And 255
        PSet(x, y), RGB(r, r , r)         ' gray scale
        ' PSet(x, y), RGB(r, 255 - r, 0)  ' red + green
        ' PSet(x, y), RGB(r, 0, 0)        ' red
    Next
Next
 
' empty keyboard buffer
While Inkey <> "" : Wend
WindowTitle "Close window or hit any key to end program"
Sleep
End