Matrix with two diagonals: Difference between revisions

Added Arturo implementation
(Added Sidef)
(Added Arturo implementation)
Line 330:
0 1 0 0 0 0 1 0
1 0 0 0 0 0 0 1</pre>
 
=={{header|Arturo}}==
 
<lang rebol>drawSquare: function [side][
loop 1..side 'x ->
print map 1..side 'y [
(any? @[x=y side=x+y-1])? -> 1 -> 0
]
]
 
drawSquare 6
print ""
drawSquare 9</lang>
 
{{out}}
 
<pre>1 0 0 0 0 1
0 1 0 0 1 0
0 0 1 1 0 0
0 0 1 1 0 0
0 1 0 0 1 0
1 0 0 0 0 1
 
1 0 0 0 0 0 0 0 1
0 1 0 0 0 0 0 1 0
0 0 1 0 0 0 1 0 0
0 0 0 1 0 1 0 0 0
0 0 0 0 1 0 0 0 0
0 0 0 1 0 1 0 0 0
0 0 1 0 0 0 1 0 0
0 1 0 0 0 0 0 1 0
1 0 0 0 0 0 0 0 1</pre>
 
=={{header|AWK}}==
Line 365 ⟶ 397:
1 0 0 0 0 0 1
</pre>
 
=={{header|Basic}}==
<lang qbasic>100 REM
1,532

edits