home *** CD-ROM | disk | FTP | other *** search
- /*
- Note: Paula did not claim the prize of a free type VMI PROLOG
- for a demonstration program. However, she is working on making
- Pooh smarter, and I anticipate that she shortly will. (R.M).
- */
-
-
- /* --------------- POOH : A PRO FOR THE AMATEUR --------------- */
- /* -------------- Copyright 1985 Paula McKerall --------------- */
-
- /* To wake pooh up, type: hello.<CR> when prompted "?-" */
- /* (Of course, type: consult(pooh).<CR> to get to his house!) */
-
- hello :- print( '\nHello! -- pooh is a program of very little brain,' ),
- print( '\nso please answer with: yes.<CR> if you mean "yes" -' ),
- print( '\nor with: no.<CR> if you mean "no" -' ),
- print( '\nor pooh will get confused!' ), nl,
- print( '\n(If you learn Prolog, you can make him smarter!)' ), nl,
- ask_want.
- ask_want :- print( '\nDo you want advice about Prolog?' ), ((yes,
- ask_fun); (sorry; confused)).
- ask_fun :- print( '\nDo you like to have fun?' ), ((learn; too_bad);
- confused).
- learn :- yes, print( '\nThen please learn Prolog; you will like it.' ),
- print( '\nAnd then you can have a good time with pooh!' ), nl, naptime.
- sorry :- no, print( '\nSorry, pooh can only give advice about Prolog.' ),
- print( '\nIf you learned Prolog, you could teach him other things!' ),
- nl, print( '\n(Besides, it is lonely in here; pooh needs a friend!)' ),
- nl, naptime.
- too_bad :- no, print( '\nToo bad, because Prolog is fun.' ),
- print( '\nYou might change your mind if you try it!' ), nl,
- print( '\n(Besides, pooh is hungry, and if you learned Prolog,' ),
- print( '\nyou could teach him how to ask for honey!)' ), nl, naptime.
- confused :- print( '\nPooh is most definitely confused.' ), nl, naptime.
- yes :- print( '\nPlease tell pooh: yes. or no. ?- ' ), read( yes );
- print( '\nThat is a strange answer. Do you mean yes?- '), read( yes ).
- no :- print( '\nCuriouser and curiouser. Do you mean no?- ' ), read( yes );
- print( '\nPooh is getting confused. Do you mean yes?- '), read( no ).
- naptime :- print( '\nPooh has to take a nap now.' ),
- print( '\nTo wake him up say: hello.<CR>' ),
- print( '\nOr to quit say: exitsys.<CR>' ).
-
- /* This is really a silly little game; pooh behaves himself if you
- give him a chance, but I think it's fun to confuse him. Just don't
- make any errors in the "rules" or you'll get the Prolog error
- messenger, who is smarter than pooh but not as cuddly; unlike the
- error messenger, pooh can't say "No." */