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 BCPL

Date:04/20/05
Author:Akira Kida
URL:n/a
Comments:0
Info:n/a
Score: (3.00 in 23 votes)
// BCPL version of 99 Bottles of Beer.
// hacked by Akira KIDA <SDI00379@niftyserve.or.jp>

GET "LIBHDR"

MANIFEST $(
    BOTTLES = 99
$)

LET START() BE $(
    LET BEERS(N, S) BE $(
        TEST N = 0 THEN WRITEF("No more bottles")
                   ELSE WRITEF("%N bottle%S", N, (N = 1) -> "", "s")
        WRITEF(" of beer%S", S)
    $)

    FOR I = BOTTLES TO 1 BY -1 DO $(
            BEERS(I, " on the wall, ")
            BEERS(I, ".*NTake one down, pass it around.*N")
            BEERS(I - 1, " on the wall.*N")
    $)
    FINISH
$)

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: