A Collection of Code Snippets in as Many Programming Languages as Possible
This project is maintained by TheRenegadeCoder
Welcome to the Baklava in Wyvern page! Here, you'll find the source code for this program as well as a description of how the program works.
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)
Baklava in Wyvern was written by:
If you see anything you'd like to change or update, please consider contributing.
No 'How to Implement the Solution' section available. Please consider contributing.
No 'How to Run the Solution' section available. Please consider contributing.