Skip to content

Commit 1a4e224

Browse files
authored
Add Baklava in Flix (#4201)
1 parent cb388f7 commit 1a4e224

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

archive/f/flix/baklava.flix

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
def baklavaLine(n: Int32): String =
2+
let numSpaces = Int32.abs(n);
3+
let numStars = 21 - 2 * numSpaces;
4+
String.repeat(numSpaces, " ") + String.repeat(numStars, "*")
5+
6+
def main(): Unit \ IO =
7+
List.range(-10, 11) |>
8+
List.map(baklavaLine) |>
9+
List.forEach(println)

0 commit comments

Comments
 (0)