Created
December 20, 2018 09:09
-
-
Save bvssvni/70fc372deaea813dc500d0fa23e223b9 to your computer and use it in GitHub Desktop.
99 bottles of beer (in Dyon)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Link to Dyon's source code