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 AIR

Date:06/25/06
Author:Takeshi-Okazaki
URL:http://www.air-lang.org
Comments:0
Info:http://www.air-lang.org
Score: (2.64 in 14 votes)
#!/usr/local/bin/air

#############################################################################
# AIR - 99 Bottles of Beer ( Ver.1 )
#  > Name = Takeshi-Okazaki
#  > URL  = WWW.AIR-LANG.ORG
#############################################################################

for(i=99;i>=0;i--){
	sing(i)
	print("\n")
}

def sing(i){
	if(i==0){
		print("No more bottles of beer on the wall, no more bottles of beer.\n")
		print("Go to the store and buy some more, 99 bottles of beer on the wall.\n")
	}
	elif(i==1){
		print("1 bottle of beer on the wall, 1 bottle of beer.\n")
		print("Take one down and pass it around, no more bottles of beer on the wall.\n")
	}
	elif(i==2){
		print("2 bottles of beer on the wall, 2 bottles of beer.\n")
		print("Take one down and pass it around, 1 bottle of beer on the wall.\n")
	}
	else{
		print("%d bottles of beer on the wall, %d bottles of beer.\n",i,i)
		print("Take one down and pass it around, %d bottles of beer on the wall.\n",i-1)
	}
}

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: