home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / l / l217 / 2.ddi / EXAMPLES / CH05EX14.PRO < prev    next >
Encoding:
Prolog Source  |  1990-03-26  |  443 b   |  25 lines

  1. /*
  2.    Copyright (c) 1986, 90 by Prolog Development Center
  3. */
  4.  
  5. predicates
  6.    action(integer)
  7.  
  8. clauses
  9.    action(1) :- !,
  10.       write("You typed 1.").
  11.  
  12.    action(2) :- !,
  13.       write("You typed two.").
  14.  
  15.    action(3) :- !,
  16.       write("Three was what you typed.").
  17.  
  18.    action(_) :- !,
  19.       write("I don't know that number!").
  20.  
  21. goal
  22.    write("Type a number from 1 to 3: "),
  23.    readreal(Choice), 
  24.    action(Choice).   
  25.