Language Slick-C
| Date: | 04/20/05 |
| Author: | Siegfried Hirsch |
| URL: | n/a |
| Comments: | 1 |
| Info: | http://www.slickedit.com |
| Score: |
/* 99 Bottles of Beer in Slick-C
-- Slick-C is the programming language of
-- Visual Slickedit from Slickedit Inc.
-- More on http://www.slickedit.com
-- programmed by: Siegfried Hirsch, http://www.hhs.de
-- This is a new command for the editor which must
-- be loaded with the "load" command
-- Then it could be used to insert the song into
-- the current editor window with an argument of
-- the number of bottles you would like to drink.
-- CommandLine: bottles 99 <return>
*/
_command bottles(...) {
param = arg(1);
if (param=="" || ! isinteger(param)) {
message('Please give number of bottles');
return(1);
}
for (i = param; i > 0; i--) {
insert_line(i ' Bottles of beer on the wall,' );
insert_line(i ' Bottles of beer.');
insert_line( "Take one down, pass it around,");
if (i - 1 == 0) {
insert_line ("Go to the store and buy some more.");
} else {
insert_line(i-1 " bottles of beer on the wall.");
}
insert_line("");
}
}
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