% bottles1.pl

% Solution based on recursion
%
bottles(0) :-
	format("Now, they are all gone.").
bottles(1) :-
	format("1 bottle of beer on the wall. "),
	take_one(1,New),
	bottles(New).
bottles(Old) :-
	format("~d bottles of beer on the wall. ", Old),
	take_one(Old,New),
	bottles(New).

take_one(In,Out) :-
	Out is In - 1,
	format("Take one down, and pass it around.\n").

