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 Inform

(historic version)

Date:04/20/05
Author:Torbjorn Andersson
URL:n/a
Comments:1
Info:http://www.doggysoft.co.uk/inform
Score: (2.72 in 111 votes)
Inform is a compiler meant for writing adventure games for the 
so-called "Z-machine" created by Infocom. 
<a href=http://www.doggysoft.co.uk/inform>Click here</a> for more information.

! ---------------------------------------------------------------------------
!  99 Bottles of Beer on the Wall, Inform version [smaller]
!       _
!  Torbjorn Andersson, (d91tan@Minsk.DoCS.UU.SE) December 1995
! ---------------------------------------------------------------------------

! For technical reasons, the first function is not allowed to use local
! variables.

Global i = 99;

[ Main;
    print "^^^^";

    while (i > 0) {
        new_line;
        print i, (char) ' ', (PluralBottle) i, " of beer on the wall,^";
        print (Chorus) i--;
        print "You take one down & pass it around^";
        print (Chorus) i;
    }

    @read_char 1 i;
    quit;
];

[ PluralBottle n;
    if (n == 1)
        print "bottle";
    else
        print "bottles";
];

[ Chorus n;
    print "  ";

    if (n == 0)
        print "No more";
    else
        print n;

    print_ret (char) ' ', (PluralBottle) n, " of beer";
];

end;

Download Source | Write Comment

Alternative Versions

VersionAuthorDateCommentsRate
version 6Torbjörn Andersson04/20/050

Comments

>>  ric said on 06/01/08 04:09:43

ric I love the way you've subtly changed the lyrics to make it read more like an adventure game! :-)

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: