real language

Bookmarking Digg Diigo DZone Earthlink Google
Windows Live LookLater Ma.gnolia Reddit Rojo StumbleUpon Technorati

Language 1C Enterprize

Author:Alexey Baranov
Score: (2.96 in 49 votes)
// calling by pressing button on form 
// Alexey Baranov
Procedure bottles()
	s = "s";     
	beer = 99;
	While beer<>0 do
		Message(String(beer) + " bottle " + s + " of beer on the wall, " + String(beer) + " bottle" + s +
" of beer."); 
		Message("Take one and pass it around.");
		beer = beer - 1;
		s = ?(beer = 1,"","s");
	Message("No more bottles of beer on the wall.");
	Message("No more bottles of beer...");
	Message("Go to the story and buy some more...");
	Message("99 bottles of beer.");

Download Source | Write Comment

Alternative Versions


>>  alex said on 07/26/05 08:35:16

alex %))

>>  hell0g said on 04/13/09 15:31:17

hell0g faken rashen bydlosheet.
bottles - is typed 98 times, bottle - only 1, and all 99 times the cheking is making.

>>  barrym said on 07/10/10 07:13:17

barrym hellOg, I think that Alexey did it that way because he was thinking of source size
considerations rather than execution speed (he could have taken it a bit further by
putting a 'no more' check and substitution inside the loop as well).
Performing a repetitive check is one of the few things that computers do

>>  barrym said on 07/14/10 08:02:28

barrym Ugh! After going through the trouble of defending Alexey's coding, I realized that
his output is missing the fourth fragment of all the verses except the last!

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!




Security Code: