Voting

Category

real language

Bookmarking

Del.icio.us Digg Diigo DZone Earthlink Google Kick.ie
Windows Live LookLater Ma.gnolia Reddit Rojo StumbleUpon Technorati

Language April

Date:04/20/05
Author:John Knottenbelt
URL:n/a
Comments:0
Info:n/a
Score: (2.89 in 28 votes)
-- 
-- 99 Bottles of Beer in April
-- John Knottenbelt
-- 
-- April is a a programming language for building DAI and other
-- types of distributed applications requiring the transmission
-- and manipulation of complex symbolic data.
-- 
--    http://www.doc.ic.ac.uk/~klc/april1.html
-- 

program {
  main() {
    drink(99);
    "Time to buy some more beer\n" >> stdout;
    fflush(stdout)
  };

  drink = {
    0 -> {}
  | i -> {
      bottles(i) ++ " on the wall,\n" ++
      bottles(i) ++ ".\n" ++
      "take one down, pass it around,\n" ++
      bottles(i) ++ " on the wall.\n\n" >> stdout;
      drink(i-1)
    }
  };

  bottles = {
    0 => "no bottles of beer"
  | 1 => "1 bottle of beer"
  | N => N^0 ++ " bottles of beer"
  }
} execute main;

Download Source | Write Comment

Alternative Versions

Comments

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!

Name:

eMail:

URL:

Security Code:
  
Comment: