Pascal's triangle: Difference between revisions

Content added Content deleted
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 = newSeq[Natural](TRILEN) # Avoid reallocations
var triangle = newSeqOfCap[Natural](TRILEN) # Avoid reallocations


proc printPascalTri(row: Natural, result: var seq[Natural]) =
proc printPascalTri(row: Natural, result: var seq[Natural]) =