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"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
bvssvni commentedDec 20, 2018
Link to Dyon's source code