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 Corn

Date:09/21/05
Author:caminoix
URL:http://p2p.info.pl
Comments:0
Info:http://corn.telefonia.pl/index.html
Score: (3.00 in 10 votes)
//Corn is designed for modelling concurrency and advanced computation. It provides lazy
//evaluation between concurrently worked threads, with object-oriented and functional style of
//semantics. It can be also used for parallel computation. - http://corn.telefonia.pl/index.html

//If you like this script, I would be most grateful if you could visit
//http://p2p.info.pl/eng/index.php and click a Google ad ;)


class ninetynine.bottles
    when drink => {
        let bottles = fun cnt1,s1,cnt2,s2 => {
            **user.println(cnt1," bottle",s1," of beer on the wall, ",
	                                   cnt1," bottle",s1," of beer.");
            user.println("Take one down and pass it around, ",
	                      cnt2," bottle",s2," of beer on the wall.\n")
        }, count in {
        count=99;
        times 99,{
            switch **count in
                1 then **bottles(1,"","no more","s");
                2 then **bottles(2,"s",1,"");
                else **bottles(count,"s",count-1,"s");
            end;
            --count
        };
        **user.println("No more bottles of beer on the wall, no more bottles of beer.");
        user.println("Go to the store and buy some more, 99 bottles of beer on the wall.")
    }}
end

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: