Pascal's triangle: Difference between revisions
Content added Content deleted
m (→{{header|Nim}}) |
|||
Line 4,148: | Line 4,148: | ||
<lang nim>const ROWS = 10 |
<lang nim>const ROWS = 10 |
||
const TRILEN = toInt(ROWS * (ROWS + 1) / 2) # Sum of arth progression |
const TRILEN = toInt(ROWS * (ROWS + 1) / 2) # Sum of arth progression |
||
var triangle = |
var triangle = newSeqOfCap[Natural](TRILEN) # Avoid reallocations |
||
proc printPascalTri(row: Natural, result: var seq[Natural]) = |
proc printPascalTri(row: Natural, result: var seq[Natural]) = |