Skip to content

jrg94/jrg94

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

305 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to My Profile!

This week's code snippet, Baklava in Wyvern, is brought to you by Subete and the Sample Programs repo.

require stdout

def strRepeat(n:Int, s:String): String
    if (n < 1) { "" } else { s + strRepeat(n - 1, s) }

def abs(n:Int): Int
    if (n < 0) { -n } else { n }

def baklava(n:Int, end:Int): Unit
    // This is definitely the weirdest formatting for an if-else statement that I've ever seen
    if (n > end)
            unit
        else
            val numSpaces:Int = abs(n)
            stdout.print(strRepeat(numSpaces, " ") + strRepeat(21 - 2 * numSpaces, "*") + "\n")
            baklava(n + 1, end)

baklava(-10, 10)

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: 🍎)

Also, here are some fun links you can use to support my work.

An image of @jrg94's Holopin badges, which is a link to view their full Holopin profile


This document was automatically rendered on 2026-07-24 using SnakeMD.

About

Jeremy Grifski's GitHub profile

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors