99 bottles of beer: Difference between revisions

Content added Content deleted
imported>Arakov
Line 13,938: Line 13,938:
=={{header|YAMLScript}}==
=={{header|YAMLScript}}==
<syntaxhighlight lang="yaml">
<syntaxhighlight lang="yaml">
#!/usr/bin/env yamlscript
#!/usr/bin/env ys-0


# Print the verses to "99 Bottles of Beer"
# Print the verses to "99 Bottles of Beer"
#
#
# usage:
# usage:
# yamlscript 99-bottles.ys [<count>]
# ys 99-bottles.ys [<count>]


defn main(number=99):
defn main(&[number]):
each [n ((number || 99) .. 1)]:
map(say):
map(paragraph):
say:
(number .. 1)
paragraph: n


defn paragraph(num): |
defn paragraph(num): |
Line 13,957: Line 13,957:


defn bottles(n):
defn bottles(n):
???:
cond:
(n == 0) : "No more bottles"
(n == 0) "No more bottles"
(n == 1) : "1 bottle"
(n == 1) "1 bottle"
:else : "$n bottles"
:else str(n " bottles")</syntaxhighlight>
</syntaxhighlight>


=={{header|Yorick}}==
=={{header|Yorick}}==