Baklava in Moonscript

Published on 30 December 2024 (Updated: 30 December 2024)

Welcome to the Baklava in Moonscript page! Here, you'll find the source code for this program as well as a description of how the program works.

Current Solution

string_repeat = (s, n) ->
  result = ""
  for i = 1, n
    result ..= s
  return result

for i = -10, 10
  num_spaces = math.abs i
  num_stars = 21 - 2 * num_spaces
  print string_repeat(" ", num_spaces) .. string_repeat("*", num_stars)

Baklava in Moonscript was written by:

If you see anything you'd like to change or update, please consider contributing.

How to Implement the Solution

No 'How to Implement the Solution' section available. Please consider contributing.

How to Run the Solution

No 'How to Run the Solution' section available. Please consider contributing.