Baklava in Clojure

Published on 15 January 2025 (Updated: 15 January 2025)

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

Current Solution

(ns baklava
  (:gen-class)
  (:require [clojure.string :refer [join]])
)

(defn repeat-string [n, s]
  (join (repeat n s))
)

(defn baklava-line [n]
  (def num-spaces (abs (- n 10)))
  (def num-stars (- 21 (* 2 num-spaces)))
  (str (repeat-string num-spaces " ") (repeat-string num-stars "*"))
)

(defn baklava [n]
  (join "\n" (map baklava-line (range 0 n)))
)

(println (baklava 21))

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