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 |
#!/usr/bin/env ys-0 |
||
# Print the verses to "99 Bottles of Beer" |
# Print the verses to "99 Bottles of Beer" |
||
# |
# |
||
# usage: |
# usage: |
||
# |
# ys 99-bottles.ys [<count>] |
||
defn main(number |
defn main(&[number]): |
||
each [n ((number || 99) .. 1)]: |
|||
map(say): |
|||
say: |
|||
paragraph: n |
|||
defn paragraph(num): | |
defn paragraph(num): | |
||
Line 13,957: | Line 13,957: | ||
defn bottles(n): |
defn bottles(n): |
||
cond: |
|||
(n == 0) |
(n == 0) "No more bottles" |
||
(n == 1) |
(n == 1) "1 bottle" |
||
:else |
:else str(n " bottles")</syntaxhighlight> |
||
</syntaxhighlight> |
|||
=={{header|Yorick}}== |
=={{header|Yorick}}== |