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 Pawn

Date:05/19/07
Author:Anonymous
URL:n/a
Comments:3
Info:http://www.compuphase.com/pawn/pawn.htm
Score: (2.00 in 9 votes)
/* PAWN */

main()
{
	for(new bottles = 99;bottles > 1;bottles--)
	{
		printf "%d bottles of beer on the wall, %d bottles of beer.\n",bottles,bottles
		printf "Take one down and pass it around, %d bottles of beer on the wall.\n\n",bottles
	}
	
	printf "1 bottle of beer on the wall, 1 bottle of beer.\n"
	printf "Take one down and pass it around, no more bottles of beer on the wall.\n\n"

	printf "No more bottles of beer on the wall, no more bottles of beer.\n"
	printf "Go to the store and buy some more, 99 bottles of beer on the wall."
}

Download Source | Write Comment

Alternative Versions

Comments

>>  Rodger Benham said on 02/18/08 11:40:08

Rodger Benham That is in no way the proper way to invoke functions. All functions like printf should be encapsulated in () brackets, then declare EOS with the ';' character.

Infact, this can all be done in one function, let alone two additional ones. PAWN was not called Small C previously without reason, why are you programming like VB?

/* PAWN */

main()
{
for(new bottles = 99;bottles > 1;bottles--)
{
printf("%d bottles of beer on the wall, %d bottles of beer.\nTake one down and pass it around, %d bottles of beer on the wall.\n\n",bottles,bottles,bottles);
}

printf("1 bottle of beer on the wall, 1 bottle of beer.\nTake one down and pass it around, no more bottles of beer on the wall.\n\nNo more bottles of beer on the wall, no more bottles of beer.\nGo to the store and buy some more, 99 bottles of beer on the wall.";);
}

Just my 2c. :)

>>  David Fishman said on 11/26/08 20:08:55

David Fishman Excellent !
Really, why try to include the last 2 cases into the general loop.
Automate what is easy and do manually what does not fit the pattern.
Perl guy

>>  BIANCARosa32 said on 05/26/10 06:14:09

BIANCARosa32 Following my exploration, millions of persons in the world get the <a href="http://lowest-rate-loans.com/topics/mortgage-loans">mortgage loans</a> at various banks. So, there's good chances to receive a commercial loan in any country.

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: