home *** CD-ROM | disk | FTP | other *** search
Prolog Source | 1990-03-26 | 443 b | 25 lines |
- /*
- Copyright (c) 1986, 90 by Prolog Development Center
- */
-
- predicates
- action(integer)
-
- clauses
- action(1) :- !,
- write("You typed 1.").
-
- action(2) :- !,
- write("You typed two.").
-
- action(3) :- !,
- write("Three was what you typed.").
-
- action(_) :- !,
- write("I don't know that number!").
-
- goal
- write("Type a number from 1 to 3: "),
- readreal(Choice),
- action(Choice).
-