Jump to content

Pascal's triangle: Difference between revisions

Add Nimrod
(Added zkl)
(Add Nimrod)
Line 1,833:
<lang nial>|loaddefs 'pascal.nial'
|pascal 5</lang>
 
=={{header|Nimrod}}==
<lang nimrod>import sequtils
 
proc pascal(n: int) =
var row = @[1]
for r in 1..n:
echo row
row = zip(row & @[0], @[0] & row).mapIt(int, it[0] + it[1])
 
pascal(10)</lang>
 
=={{header|OCaml}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.