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 Pike

Date:04/20/05
Author:Ivan Voras
URL:n/a
Comments:0
Info:http://pike.roxen.com/
Score: (2.89 in 9 votes)
#!/usr/local/bin/pike
// A simple version made in Pike (http://pike.roxen.com/)
// Author: Ivan Voras <ivoras@fer.hr>

int main() {
	int i = 99;
	
	while (i > 0) {

		if (i > 1)
			write (i+" bottles of beer on the wall, "+i+" bottles of beer,\n");
		else
			write ("one bottle of beer on the wall, one bottle of beer,\n");

		write ("take one down, pass it around,\n");
		i--;
		switch (i) {
			case 0:
				write ("no more bottles of beer on the wall.\n");
				break;
			case 1:
				write ("one bottle of beer on the wall.\n");
				break;
			default:
				write (i+" bottles of beer on the wall.\n");
				break;
		}
	}
	
	return 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: