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

 
    nomainwin
 
    w =512
    '   allow for title bar and window border
    WindowWidth  =w +2
    WindowHeight =w +34
 
    open "XOR Pattern" for graphics_nsb_nf as #w
 
    #w "trapclose quit"
 
    #w "down"
 
    for x =0 to w -1
        for y =0 to w -1
            b =( x xor y) and 255
            print b
            #w "color "; 255 -b; " "; b /2; " "; b
            #w "set "; x; " "; w -y -1
            scan
        next y
    next x
 
    #w "flush"
 
    wait
 
    sub quit j$
    close #w
    end
    end sub
 