Pascal's triangle: Difference between revisions
Content added Content deleted
m (→{{header|AppleScript}}: Tidied) |
(Added solution for Action!) |
||
Line 161: | Line 161: | ||
15 pasc |
15 pasc |
||
</lang> |
</lang> |
||
=={{header|Action!}}== |
|||
<lang Action!>PROC Main() |
|||
BYTE count=[10],row,item |
|||
CHAR ARRAY s(5) |
|||
INT v |
|||
FOR row=0 TO count-1 |
|||
DO |
|||
v=1 |
|||
FOR item=0 TO row |
|||
DO |
|||
StrI(v,s) |
|||
Position(2*(count-row)+4*item-s(0),row+1) |
|||
Print(s) |
|||
v=v*(row-item)/(item+1) |
|||
OD |
|||
PutE() |
|||
OD |
|||
RETURN</lang> |
|||
{{out}} |
|||
[https://gitlab.com/amarok8bit/action-rosetta-code/-/raw/master/images/Pascal's_triangle.png Screenshot from Atari 8-bit computer] |
|||
<pre> |
|||
1 |
|||
1 1 |
|||
1 2 1 |
|||
1 3 3 1 |
|||
1 4 6 4 1 |
|||
1 5 10 10 5 1 |
|||
1 6 15 20 15 6 1 |
|||
1 7 21 35 35 21 7 1 |
|||
1 8 28 56 70 56 28 8 1 |
|||
1 9 36 84 126 126 84 36 9 1 |
|||
</pre> |
|||
=={{header|Ada}}== |
=={{header|Ada}}== |