Language Ursala
(functional programming)
| Date: | 07/13/08 |
| Author: | Dennis Furey |
| URL: | http://www.basis.uklinux.net |
| Comments: | 0 |
| Info: | http://www.basis.uklinux.net/ursala |
| Score: |
# compile with --show to display the lyrics
#import nat
# each function takes a natural number to a block of text
quantity = # forms the appropriate plural
~&iNC+ --' of beer'+ ~&?(
1?=/'1 bottle'! --' bottles'+ ~&h+ %nP,
'no more bottles'!)
verse =
^(successor,~&); ("s","n"). -[
-[quantity "s"]- on the wall, -[quantity "s"]-,
Take one down and pass it around, -[quantity "n"]- on the wall.]-
refrain "n" =
-[
No more bottles of beer on the wall, -[quantity 0]-.
Go to the store and buy some more, -[quantity "n"]- on the wall.]-
whole_song "n" = ~&tttt2SPSNiCSL (verse*x iota "n")--<refrain "n">
main = whole_song 99
Download Source | Write Comment
Download Source | Write Comment
Add Comment
Please provide a value for the fields Name,
Comment and Security Code.
This is a gravatar-friendly website.
E-mail addresses will never be shown.
Enter your e-mail address to use your gravatar.
Please don't post large portions of code here! Use the form to submit new examples or updates instead!
Comments