This week's code snippet, Baklava in Formality, is brought to you by Subete and the Sample Programs repo.
baklavaLine(n: Nat): String
let numSpaces = if Nat.gte(n, 10) then Nat.sub(n, 10) else Nat.sub(10, n)
let numStars = Nat.sub(21, Nat.mul(2, numSpaces))
String.repeat(" ", numSpaces) | String.repeat("*", numStars) | "\n"
baklava(lines: String, n:Nat): String
case n {
zero: lines | baklavaLine(0),
succ: lines | baklavaLine(n) | baklava(lines, n.pred)
}
Main: IO(Unit)
do IO {
IO.put_string(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: 🍎)
- ✒️ The Worst Use Cases for Generative AI That Are Already Mainstream
- ✒️ ChatGPT Is Stack Overflow for the Lazy and Helpless
- ✒️ The Acceleration of the Enshittification of Everything
- 🍎 4 Values We Have to Stop Pushing in Engineering Education
- ✒️ Generative AI Has a Short Shelf Life
- ✒️ Reflecting on My First Trip to Japan
- 🍎 SB1 Is the Death of Higher Education in Ohio
- ✒️ No, Generative AI Is Not Just Another Innovation
- 🍎 Generative AI Makes It Feel Bad to Be an Educator
- ✒️ The Problem With Centrism: A Case Study
Also, here are some fun links you can use to support my work.
This document was automatically rendered on 2025-07-11 using SnakeMD.