Optional parameters: Difference between revisions

Content added Content deleted
(Updated to work with Nim 1.4: added missing parameter type, replaced "future" with "sugar", replaced "repeatChar" with "repeat".)
Line 2,057: Line 2,057:


=={{header|Nim}}==
=={{header|Nim}}==
<lang nim>import algorithm, strutils, future
<lang nim>import algorithm, strutils, sugar


proc printTable(a) =
proc printTable(a: seq[seq[string]]) =
for row in a:
for row in a:
for x in row: stdout.write x, repeatChar(4 - x.len)
for x in row: stdout.write x, repeat(' ', 4 - x.len)
echo ""
echo ""
echo ""
echo ""