Baklava in Shen

Published on 28 October 2024 (Updated: 28 October 2024)

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

Current Solution

(define string-repeat
  N C -> (if (> N 0) (cn C (string-repeat (- N 1) C)) "")
)

(define abs
  N -> (if (< N 0) (- 0 N) N)
)

(define spaces
  N -> (string-repeat (abs N) " ")
)

(define stars
  N -> (string-repeat (- 21 (* 2 (abs N))) "*")
)

(define baklava
  N -> (if (<= N 10)
    (do
      (output "~A~A~%" (spaces N) (stars N))
      (baklava (+ 1 N))
    )
    (output "")
  )
)

(baklava -10)

Baklava in Shen 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.