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 Parlog

Date:10/19/05
Author:Alin Suciu
URL:http://users.utcluj.ro/~suciu/
Comments:2
Info:http://www.parlog.com/en/parlog.html
Score: (3.00 in 40 votes)
% 99 bottles of beer generator in Parlog
% author: Alin Suciu <alin.suciu@cs.utcluj.ro>

mode bottles.
bottles <- 
    bottles(99).

mode bottles(?).
bottles(1) <- 
    write('1 bottle of beer on the wall, 1 bottle of beer.') & nl &
    write('Take one down, and pass it around, no more bottles of beer on the wall.') & nl & nl &
    write('No more bottles of beer on the wall, no more bottles of beer.') & nl &
    write('Go to the store and buy some more, 99 bottles of beer on the wall.') & nl.

bottles(N) <-
    N > 1 : 
    N1 is N - 1 ,
    write(N) & write(' bottles of beer on the wall, ') & 
    write(N) & write(' bottles of beer.') & nl &
    write('Take one down and pass it around, ') &
    write(N1), write(' bottles of beer on the wall.') & nl & nl,
    bottles(N1).

Download Source | Write Comment

Alternative Versions

Comments

>>  annonymous said on 11/22/05 16:30:07

annonymous nashpa profii de la utcn

ps: in caz ca u v-ati prin sunt la universitatea tehnica Cluj Napoca
grupa 3242 si stau in observator caminul 7 camera 28 la parter...

>>  Tom Conlon said on 12/24/05 22:17:03

Tom Conlon Brilliant, Alin! Well done. Thank you for a big smile!

But where's the parallelism?!

I like to drink several bottles concurrently ;-)

Tom

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: