Multiplication tables: Difference between revisions

m
m (→‎{{header|APL}}: Formatting)
Line 750:
12 24 36 48 60 72 84 96 108 120 132 144</pre>
 
Getting just the top half, and some labels, requires a bit more work. Text alignment varies with implmentation so the numbers will need some tweaking:
 
{{works with|Dyalog APL}}
<lang apl>⎕←(' ×',2↑' '),4 0⍕⍳12⋄{⎕←((4 0⍕⍵),⊂1(4×(⍵-1))⍴' '),4 0⍕(⍵-1)↓(⍵×⍳12)}¨⍳12</lang>
 
{{works with|GNU APL}}
<lang apl>⎕←(' ×',4↑' '),4 0⍕⍳12⋄{⎕←((4 0⍕⍵),⊂1(4×(⍵-1))⍴' '),4 0⍕(⍵-1)↓(⍵×⍳12)}¨⍳12</lang>
 
{{Out}}
1,479

edits