countdown(0) :-
write(0), nl,
!.
countdown(X) :-
X > 0, 
write(X), nl,
Y is X-1,
countdown(Y).