We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 35553f3 commit 336432aCopy full SHA for 336432a
archive/g/gluon/baklava.glu
@@ -0,0 +1,22 @@
1
+let io @ { ? } = import! std.io
2
+let int @ { ? } = import! std.int
3
+
4
+rec let repeat_string s n : String -> Int -> String =
5
+ if n > 0 then
6
+ s ++ (repeat_string s (n - 1))
7
+ else
8
+ ""
9
10
+let baklava_line n : Int -> String =
11
+ let num_spaces = int.abs n
12
+ let num_stars = 21 - 2 * num_spaces
13
+ (repeat_string " " num_spaces) ++ (repeat_string "*" num_stars)
14
15
+rec let baklava n ne : Int -> Int -> io.IO () =
16
+ if n <= ne then
17
+ io.println (baklava_line n)
18
+ baklava (n + 1) ne
19
20
+ io.print ""
21
22
+baklava -10 10
0 commit comments