Mosaic matrix: Difference between revisions
Added Quackery.
(→{{header|JavaScript}}: Added a version in JavaScript) |
(Added Quackery.) |
||
Line 676:
1 0 1 0 1 0 1 0
0 1 0 1 0 1 0 1</pre>
=={{header|Quackery}}==
<lang Quackery> [ 1 & not ] is even ( n --> b )
[ dip [ temp put [] ]
temp share times
[ temp share split
dip
[ nested join ] ]
drop temp release ] is matrixify ( n [ --> [ )
[ dup 2dup * 1+ 1 >>
' [ 1 0 ] swap of
matrixify
swap even if
[ [] swap witheach
[ i even if
[ behead join ]
nested join ] ] ] is mosaic ( n --> [ )
8 mosaic
witheach
[ witheach [ echo sp ] cr ]
cr
9 mosaic
witheach
[ witheach [ echo sp ] cr ]</lang>
{{out}}
<pre>1 0 1 0 1 0 1 0
0 1 0 1 0 1 0 1
1 0 1 0 1 0 1 0
0 1 0 1 0 1 0 1
1 0 1 0 1 0 1 0
0 1 0 1 0 1 0 1
1 0 1 0 1 0 1 0
0 1 0 1 0 1 0 1
1 0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1 0
1 0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1 0
1 0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1 0
1 0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1 0
1 0 1 0 1 0 1 0 1
</pre>
=={{header|Raku}}==
|