Munching squares: Difference between revisions

Added EchoLisp
m (→‎{{header|Sidef}}: minor code simplification)
(Added EchoLisp)
Line 321:
}
}</lang>
 
=={{header|EchoLisp}}==
Use the '''plot''' library, hsv->rgb ((x xor y) modulo m) as color table, and see the nice results here : http://www.echolalie.org/echolisp/help.html#bit-map .
<lang scheme>
(lib 'types)
(lib 'plot)
(plot-size 512 512) ;; for example
 
;; use m = 16, 32, 44, .. to change the definition (number of losanges)
(define (plot-munch (m 256))
(define PIX (pixels->int32-vector)) ;; get canvas image
(define (pcolor x y) ;; color at (x,y)
(hsv->rgb
(// (bitwise-xor (modulo x m) (modulo y m)) m)
0.9
0.9))
(pixels-map pcolor PIX)
(vector->pixels PIX)) ;; draw canvas image
 
(plot-much) ;; ESC to see tge drawing
</lang>
 
 
=={{header|GLSL}}==