Skip to content

Commit 17039f6

Browse files
authored
Add Baklava in Lolcode (#4131)
1 parent 7d95a61 commit 17039f6

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

archive/l/lolcode/baklava.lol

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
HAI 1.2
2+
3+
BTW Function to output a string n times
4+
HOW IZ I OUTPUT_N_TIMES_FOR YR string AN YR n
5+
IM IN YR loop UPPIN YR i TIL BOTH SAEM i AN BIGGR OF i AN n
6+
VISIBLE ":{string}"!
7+
IM OUTTA YR loop
8+
IF U SAY SO
9+
10+
BTW For n = 0 to 20
11+
IM IN YR loop UPPIN YR n TIL BOTH SAEM n AN BIGGR OF n AN 21
12+
BTW num_spaces = abs(n - 10)
13+
I HAS A num_spaces ITZ DIFF OF n AN 10
14+
DIFFRINT num_spaces AN BIGGR OF 0 AN num_spaces
15+
O RLY?
16+
YA RLY
17+
num_spaces R PRODUKT OF -1 AN num_spaces
18+
OIC
19+
20+
BTW num_stars = 21 - 2 * num_spaces
21+
I HAS A num_stars ITZ DIFF OF 21 AN PRODUKT OF 2 AN num_spaces
22+
23+
BTW Output " " num_spaces times
24+
I IZ OUTPUT_N_TIMES_FOR YR " " AN YR num_spaces MKAY
25+
26+
BTW Output "*" num_stars times
27+
I IZ OUTPUT_N_TIMES_FOR YR "*" AN YR num_stars MKAY
28+
29+
BTW Output newline
30+
VISIBLE ""
31+
IM OUTTA YR loop
32+
33+
KTHXBYE

0 commit comments

Comments
 (0)