Four sides of square: Difference between revisions
Content added Content deleted
(Added Sidef) |
Drkameleon (talk | contribs) (Added Arturo implementation) |
||
Line 96: | Line 96: | ||
1 1 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 join.with:" " map 1..side 'y [ |
|||
(any? @[x=1 y=1 x=side y=side])? -> 1 -> 0 |
|||
] |
|||
] |
|||
drawSquare 4 |
|||
print "" |
|||
drawSquare 6</lang> |
|||
{{out}} |
|||
<pre>1 1 1 1 |
|||
1 0 0 1 |
|||
1 0 0 1 |
|||
1 1 1 1 |
|||
1 1 1 1 1 1 |
|||
1 0 0 0 0 1 |
|||
1 0 0 0 0 1 |
|||
1 0 0 0 0 1 |
|||
1 0 0 0 0 1 |
|||
1 1 1 1 1 1</pre> |
|||
=={{header|AWK}}== |
=={{header|AWK}}== |
||
<lang AWK> |
<lang AWK> |