Skip to content

Instantly share code, notes, and snippets.

@bvssvni
Created December 20, 2018 09:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bvssvni/70fc372deaea813dc500d0fa23e223b9 to your computer and use it in GitHub Desktop.
Save bvssvni/70fc372deaea813dc500d0fa23e223b9 to your computer and use it in GitHub Desktop.
99 bottles of beer (in Dyon)
fn main() {
n := 99
println(link {
link i n {
b := n-i
bottles(b)" of beer on the wall, "bottles(b)" of beer.\n"
"Take one down, pass it around, "bottles(b-1)" of beer on the wall.\n\n"
}
"No more bottles of beer on the wall, no more bottles of beer.\n"
"Go to the store and buy some more, "n" bottles of beer on the wall.\n"
})
}
bottles(n: f64) =
if n == 0 {"no more bottles"}
else if n == 1 {"1 bottle"}
else {str(n) + " bottles"}
@bvssvni
Copy link
Author

bvssvni commented Dec 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment