Matrix with two diagonals: Difference between revisions
Content added Content deleted
Not a robot (talk | contribs) (Add APL) |
|||
Line 95: | Line 95: | ||
</pre> |
</pre> |
||
=={{header|APL}}== |
|||
{{works with|Dyalog APL}} |
|||
<lang apl>twoDiagonals ← (⌽∨⊢)∘.=⍨∘⍳ |
|||
twoDiagonals¨ 10 11</lang> |
|||
{{out}} |
|||
<pre> 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 1 |
|||
0 1 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 1 0 |
|||
0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 |
|||
0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 0 |
|||
0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 |
|||
0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 |
|||
0 0 0 1 0 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 |
|||
0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 0 0 0 |
|||
0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 1 0 0 |
|||
1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0 |
|||
1 0 0 0 0 0 0 0 0 0 1 </pre> |
|||
=={{header|AppleScript}}== |
=={{header|AppleScript}}== |
||
===Procedural=== |
===Procedural=== |