Skip to content

Commit

Permalink
Add Baklava in Little (#4137)
Browse files Browse the repository at this point in the history
  • Loading branch information
rzuckerm authored Dec 27, 2024
1 parent 0c55222 commit f67ad54
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions archive/l/little/baklava.l
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
string repeat_string(string s, int n) {
int i;
string result = "";
for (i = 0; i < n; i++) {
result[END + 1] = s;
}

return result;
}

int n, numSpaces, numStars;
for (n = -10; n <= 10; n++) {
numSpaces = abs(n);
numStars = 21 - 2 * numSpaces;
printf("%s%s\n", repeat_string(" ", numSpaces), repeat_string("*", numStars));
}

0 comments on commit f67ad54

Please sign in to comment.