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