Pascal's triangle: Difference between revisions

(Forth)
Line 111:
cr here swap 0 do dup @ . cell+ loop drop ;
: next ( n -- )
here @swap 1- cells here + do
swap 1 ?doi @ i cell+ +!
i-1 cells here +loop @ swap;
i cells here + +!
loop drop ;
: pascal ( n -- )
dup init 1 .line
1+ 2 ?do i next i 1+ .line loop ;
 
=={{header|Fortran}}==
Anonymous user