Language GProlog
| Date: | 04/20/05 |
| Author: | Paul J. DeMarco |
| URL: | n/a |
| Comments: | 4 |
| Info: | n/a |
| Score: |
/*******************************************************
* 99 Bottles of Beer
* Paul J. DeMarco 9/20/2002
* beer.pro
* To execute start gprolog (others may work)
* consult('beer.pro').
* drink(beer,99).
*******************************************************/
english(beer,0):-
write('no more bottle of beer').
english(beer,1):-
write('1 bottle of beer').
english(beer,X):-
X >= 2,
write( X ) ,
write(' bottles of beer').
drink(beer,X):- X >= 1,
english(beer,X),
write(' on the wall, '),
english(beer,X),
write(', take one down, pass it around\n'),
X1 is X - 1,
english(beer,X1),
write(' on the wall.\n'),
drink(beer, X1).
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
This is not even a Full lyrics version!..Far from brylliant!
this code is shorter than short