Skip to content

Commit 876e2eb

Browse files
authored
Add Baklava in Nim (#4122)
1 parent d3bcc2d commit 876e2eb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

archive/n/nim/baklava.nim

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import strutils
2+
3+
for n in -10..10:
4+
var numSpaces: int = abs(n)
5+
var numStars: int = 21 - 2 * numSpaces
6+
echo repeat(" ", numSpaces), repeat("*", numStars)

0 commit comments

Comments
 (0)