Skip to content

Commit

Permalink
Add Baklava in Gerbil (#4166)
Browse files Browse the repository at this point in the history
  • Loading branch information
rzuckerm authored Jan 1, 2025
1 parent a7e8da2 commit 35553f3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions archive/g/gerbil/baklava.ss
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
(import :std/iter)
(import :std/misc/func)

(export main)

(def (string-repeat n str)
(string-join (repeat str n) "")
)

(def (main . args)
(for (i (in-range -10 11))
(def num-spaces (abs i))
(def num-stars (- 21 (* 2 num-spaces)))
(displayln (string-repeat num-spaces " ") (string-repeat num-stars "*"))
)
)

0 comments on commit 35553f3

Please sign in to comment.