RosettaCodeData/Task/Pascals-triangle/8th/pascals-triangle-1.8th
2016-12-05 23:44:36 +01:00

15 lines
331 B
Text

\ print the array
: .arr \ a -- a
( . space ) a:each ;
: pasc \ a --
\ print the row
.arr cr
dup
\ create two rows from the first, one with a leading the other with a trailing 0
[0] 0 a:insert swap 0 a:push
\ add the arrays together to make the new one
' n:+ a:op ;
\ print the first 16 rows:
[1] ' pasc 16 times