Language SymbEL
| Date: | 04/20/05 |
| Author: | Marcel Luternauer |
| URL: | n/a |
| Comments: | 0 |
| Info: | n/a |
| Score: |
/*
* 99 bottles of beer in SymbEL
*
* by Marcel Luternauer: marcel.luternauer@sicap.com
*
* SymbEL is an interpretive language, based on C, that was created to
* address the need for simplified access to data residing in the
* SunOS Kernel. The SE interpreter (package RICHPse) is available at:
* http://www.setoolkit.com
*
* After installing the interpreter, the script can be executed with:
* $ /opt/RICHPse/bin/se 99beers.se
*
*/
#define MAXBEER (99)
main() {
int beers;
string s;
printf("\n");
for(beers = MAXBEER; beers > 0 ; beers --) {
if(beers == 1) {s="";} else {s="s";}
printf("%d bottle%s of beer on the wall,\n", beers, s);
printf("%d bottle%s of beeeeer . . . ,\n", beers, s);
printf("Take one down, pass it around,\n");
if(beers == 1) {
printf("No more bottles of beer on the wall.\n\n");
} else {
if (beers == 2) {s="";} else {s="s";}
printf("%d bottle%s of beer on the wall.\n\n", beers - 1, s);
}
}
printf("Time to buy more beer!\n\n");
}
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