Language 1C Enterprize
Date: | 07/22/05 |
Author: | Alexey Baranov |
URL: | n/a |
Comments: | 4 |
Info: | http://www.1c.ru/ |
Score: | ![]() |
// calling by pressing button on form // Alexey Baranov wdayda@yahoo.com 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"); EndDo; 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."); EndProcedure
Download Source | Write Comment
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!
Comments
bottles - is typed 98 times, bottle - only 1, and all 99 times the cheking is making.
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
brilliantly!!
his output is missing the fourth fragment of all the verses except the last!