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 ddcea9d commit f64d31aCopy full SHA for f64d31a
archive/k/koka/baklava.kk
@@ -0,0 +1,13 @@
1
+fun repeat_string(s : string, n : int) {
2
+ var result := ""
3
+ list(1, n).foreach(fn(_) { result := result + s })
4
+ result
5
+}
6
+
7
+fun main() {
8
+ list(-10, 10).foreach(fn(n) {
9
+ var num_spaces := abs(n)
10
+ var num_stars := 21 - 2 * num_spaces
11
+ println(repeat_string(" ", num_spaces) + repeat_string("*", num_stars))
12
+ })
13
0 commit comments