99 bottles of beer: Difference between revisions

m (used the inline lambdas, and auto property setter)
Line 13,887:
=={{header|YAMLScript}}==
<syntaxhighlight lang="yaml">
#!/usr/bin/env yamlscript
main(number=99):
map:
- println
- map:
- paragraph
- range(number, 0, -1)
 
# Print the verses to "99 Bottles of Beer"
paragraph(num): |
#
# usage:
# yamlscript 99-bottles.ys [<count>]
 
defn main(number=99):
map(say):
- map(paragraph):
- range (number, 0,.. -1)
 
defn paragraph(num): |
$(bottles num) of beer on the wall,
$(bottles num) of beer.
Line 13,900 ⟶ 13,905:
$(bottles (num - 1)) of beer on the wall.
 
defn bottles(n):
cond???: [
(n == 0), : "No more bottles",
(n == 1), : "1 bottle",
:else, : "$n bottles" ]
</syntaxhighlight>
 
 
=={{header|Yorick}}==
55

edits