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 Brandy

Date:10/23/06
Author:Chris Rodliffe
URL:n/a
Comments:0
Info:http://jaguar.orpheusweb.co.uk/branpage.html
Score: (2.50 in 10 votes)
REM  This is written in 'Brandy', a port of BBC Basic V for multiple platforms
REM  This version tested under Linux  (other platforms should work the same)
REM  Here's the formatted version:
REM  n=99
REM  REPEAT
REM     i=3
REM     REPEAT
REM        PRINT n;" bottle";
REM        IF n<>1 PRINT "s";
REM        PRINT " of beer";
REM        IF i=3 OR i=1 PRINT " on the wall";
REM        IF i=2 PRINT: PRINT "Take one down, pass it around";: n=n-1
REM        i=i-1
REM        PRINT
REM     UNTIL i=0
REM  PRINT
REM  UNTIL n=0
REM
REM  and in the spirit of the old BBC Basic one-line programs, 
REM  here's the shortest I can get it (line breaks essential 
REM  to terminate IF statements)

n=99:REP.:i=3:REP.:P.n;" bottle";:IFn<>1P."s";
P." of beer";:IFi=3ORi=1P." on the wall";
IFi=2P.:P."Take one down, pass it around";
IFi=2n-=1
i-=1:P.:U.i=0:P.:U.n=0

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: