Language Prolog
(Tweaked Remkos version)
| Date: | 11/28/05 |
| Author: | M@ |
| URL: | n/a |
| Comments: | 2 |
| Info: | n/a |
| Score: |
% 99 bottles of beer.
% Remko Troncon <spike@kotnet.org>
% Modified by <M@>
bottles :-
bottles(99).
bottles(1) :-
write('1 bottle of beer on the wall, 1 bottle of beer,'), nl,
write('Take one down, and pass it around,'), nl,
write('Now they are all gone.'), nl,!.
bottles(X) :-
write(X), write(' bottles of beer on the wall,'), nl,
write(X), write(' bottles of beer,'), nl,
write('Take one down and pass it around,'), nl,
NX is X - 1,
write(NX), write(' bottles of beer on the wall.'), nl, nl,
bottles(NX).
Download Source | Write Comment
Alternative Versions
| Version | Author | Date | Comments | Rate |
|---|---|---|---|---|
| ISO Prolog w/ red cuts | Brent Spillner | 04/12/06 | 1 | |
| iso, using DCG | none | 04/28/11 | 0 |
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