home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / l / l216 / 2.ddi / XLCAREER.PRO < prev    next >
Encoding:
Text File  |  1987-03-23  |  1.6 KB  |  58 lines

  1.  
  2. /****************************************************************
  3.  
  4.      Turbo Prolog Toolbox
  5.      (C) Copyright 1987 Borland International.
  6.  
  7.         Demo of menu_leave
  8. ****************************************************************/
  9.  
  10. include "tdoms.pro"
  11. include "tpreds.pro"
  12. include "menu.pro"
  13.  
  14. DOMAINS
  15.   numberlist=integer*
  16.  
  17. PREDICATES
  18.   ask(numberlist,integer)
  19.   career(integer,string)
  20.   q(integer,string,stringlist)
  21.  
  22. GOAL
  23.     makewindow(1,7,0,"",0,0,25,80),
  24.     ask([1,2,3,4],Total),career(Total,Job),
  25.     makewindow(1,32,66,"Career",20,10,5,50),
  26.     nl,write("        You should be in ",Job),readchar(_).
  27.          
  28. CLAUSES
  29.   q(4,"If you were at a party and saw someone standing alone, would you:",
  30.     ["organize lots of people to go over and talk to that person",
  31.     "go over and talk to him or her yourself",
  32.     "just smile at him or her sympathetically",
  33.     "take no notice"]).
  34.  
  35.   q(3,"Which of the following activities do you most enjoy?",
  36.     [parties,"going out for a meal",sports,cinema,"flower arranging",
  37.     "reading a book"]).
  38.  
  39.   q(2,"Which one of the following best describes you?",
  40.     [obstinate,determined,ambitious,considerate,thoughtful,
  41.     "couldn't care what turns up"]).
  42.  
  43.   q(1,"Which one of the following best describes you?",
  44.     [wild,"very extroverted",extrovert,happy,"quiet and refined",
  45.     quiet,"very introverted","extremely shy"]).
  46.  
  47.   ask([],0).
  48.   ask([X | Y],S):-
  49.     ask(Y,T),q(X,Title,Choicelist),
  50.     R=4*(4-X), C=7*(4-X),
  51.     FATTR=7+16*X,
  52.     menu_leave(R,C,7,FATTR,Choicelist,Title,3,ChoiceNo),
  53.     S=T+ChoiceNo.
  54.  
  55.   career(Total,advertising):-Total<8.
  56.   career(Total,computing):-Total>7,Total<20.
  57.   career(_,archaeology).
  58.