% From the book % PROLOG PROGRAMMING IN DEPTH % by Michael A. Covington, Donald Nute, and Andre Vellino % (Prentice Hall, 1997). % Copyright 1997 Prentice-Hall, Inc. % For educational use only % File WRITENAM.PL % writename/1 (one of several versions) writename(1) :- write('One'). writename(2) :- write('Two'). writename(3) :- write('Three'). writename(X) :- X<1, write('Out of range'). writename(X) :- X>3, write('Out of range').