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 XBasic

(Handles plurals correctly, etc.)

Date:04/14/07
Author:etfan
URL:n/a
Comments:1
Info:http://www.xbasic.org/
Score: (3.00 in 16 votes)
'1) Copy this into a text file and save as BeerOnDaWall.x
'2) Get XBasic 6.2.3 at http://xbasic.sourceforge.net/
'3) Open the IDE
'4) Load BeerOnDaWall.x using file/load
'5) Run by clicking on the exclamation mark `!'
'
' This version handles the plurals correctly with
' (I hope) a bit of humor.  My proudest moment!!
' etf

PROGRAM "BeerOnDaWall"
VERSION "1.0"
DECLARE FUNCTION  Brewski ()
FUNCTION  Brewski ()

beer = 99
DO
  GOSUB Wasted: PRINT "r on the wall,"
  GOSUB Wasted: PRINT "eer.    (Hic!)"
  PRINT " Take one down, pass it around,"
  DEC beer
  GOSUB Wasted: PRINT "r on the wall.\n"
LOOP WHILE beer

SUB Wasted
  PRINT beer; " bottle";
  IF beer <> 1 PRINT "s";
  PRINT " of bee";
END SUB

END FUNCTION
END PROGRAM

Download Source | Write Comment

Alternative Versions

Comments

>>  barrym said on 09/19/10 05:53:16

barrym I like your sense of humor, but may I suggest:
1) that the hiccups should occur randomly, but with a probability that increases
as the song progresses
2) that the "no more" and "Go to the store" verses be included at the end, possibly
with some burping or vomiting included :)

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: