Mosaic matrix: Difference between revisions

Add Factor
imported>Maxima enthusiast
No edit summary
(Add Factor)
Line 614:
</pre>
 
=={{header|Factor}}==
{{works with|Factor|0.99}}
<syntaxhighlight lang="factor">USING: accessors colors kernel math math.matrices ui
ui.gadgets.grid-lines ui.gadgets.grids ui.gadgets.labels
ui.pens.solid ;
IN: mosaic
 
: <square> ( m n -- gadget )
+ 2 mod 0 = [
" 1 " <label> COLOR: AntiqueWhite2 <solid> >>interior
[ 50 >>size ] change-font
] [ "" <label> ] if ;
 
: <checkerboard> ( n -- gadget )
dup [ <square> ] <matrix-by-indices> <grid>
COLOR: gray <grid-lines> >>boundary ;
 
MAIN: [ 8 <checkerboard> "Mosaic" open-window ]</syntaxhighlight>
{{out}}
[[File:Factor-mosaic.png|thumb|center]]
 
=={{header|FreeBASIC}}==
1,808

edits