This week's code snippet, Baklava in Eta, is brought to you by Subete and the Sample Programs repo.
module Main where
baklavaLine :: Int -> String
baklavaLine n = (replicate numSpaces ' ') ++ (replicate numStars '*') ++ "\n"
where
numSpaces = abs(n - 10)
numStars = 21 - 2 * numSpaces
baklava :: String -> Int -> String
baklava s 0 = s ++ baklavaLine 0
baklava s n = s ++ baklavaLine n ++ baklava s (n - 1)
main :: IO ()
main = putStr (baklava "" 20)
Below you'll find an up-to-date list of articles by me on The Renegade Coder. For ease of browsing, emojis let you know the article category (i.e., blog: ✒️, code: 💻, meta: 💭, teach: 🍎)
- ✒️ Inside the Mind of an Engineer: How to Make Societal Issues Worse
- ✒️ How Attack on Titan Undermines Its Own Message
- 💻 Migrating to Poetry 2.x With Some Best Practices
- ✒️ Maybe Generative AI Is Just a Symptom of a Broader Problem in Tech
- 🍎 It’s Time to Collect Mid-Semester Feedback
- 💭 2024: Year in Review
- ✒️ Is Anyone Else Bothered by How Quickly We Adopted Generative AI?
- ✒️ 31 Lessons Learned as a New Dad
- 🍎 So You’re Not Sure If Computer Science Is for You
- 🍎 You Should Give Open-Ended Projects to Your Students
Also, here are some fun links you can use to support my work.
This document was automatically rendered on 2025-04-13 using SnakeMD.