Mosaic matrix: Difference between revisions
Content added Content deleted
(Added Sidef) |
Drkameleon (talk | contribs) (Added Arturo implementation) |
||
Line 114: | Line 114: | ||
1 . 1 . 1 . 1 . 1 . 1 |
1 . 1 . 1 . 1 . 1 . 1 |
||
</pre> |
</pre> |
||
=={{header|Arturo}}== |
|||
<lang rebol>drawSquare: function [side][ |
|||
loop 1..side 'x -> |
|||
print map 1..side 'y [ |
|||
(equal? x%2 y%2)? -> 1 -> 0 |
|||
] |
|||
] |
|||
drawSquare 6 |
|||
print "" |
|||
drawSquare 9</lang> |
|||
{{out}} |
|||
<pre>1 0 1 0 1 0 |
|||
0 1 0 1 0 1 |
|||
1 0 1 0 1 0 |
|||
0 1 0 1 0 1 |
|||
1 0 1 0 1 0 |
|||
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|AWK}}== |
=={{header|AWK}}== |
||
<lang AWK> |
<lang AWK> |