Jump to content

Pascal's triangle: Difference between revisions

→‎{{header|Fantom}}: add FOCAL version
(→‎{{header|Fantom}}: add FOCAL version)
Line 2,106:
}
</lang>
 
=={{header|FOCAL}}==
<lang FOCAL>1.1 S OLD(1)=1; T %4.0, 1, !
1.2 F N=1,10; D 2
1.3 Q
 
2.1 S NEW(1)=1
2.2 F X=1,N; S NEW(X+1)=OLD(X)+OLD(X+1)
2.3 F X=1,N+1; D 3
2.4 T !
 
3.1 S OLD(X)=NEW(X)
3.2 T %4.0, OLD(X)</lang>
{{output}}
<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
= 1= 10= 45= 120= 210= 252= 210= 120= 45= 10= 1
</pre>
 
=={{header|Forth}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.