Różnice

Różnice między wybraną wersją a wersją aktualną.

Odnośnik do tego porównania

Nowa wersja
Poprzednia wersja
pl:miw:miw08_ruleruntimeg:xshell [2008/04/22 10:48]
miw utworzono
pl:miw:miw08_ruleruntimeg:xshell [2019/06/27 15:50] (aktualna)
Linia 1: Linia 1:
 +xshell.pl
 <code prolog> <code prolog>
 % From the book % From the book
Linia 21: Linia 22:
 % READSTR.PL, READNUM.PL, and GETYESNO.PL from % READSTR.PL, READNUM.PL, and GETYESNO.PL from
 % Chapter 5. % Chapter 5.
-%+ 
 + 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  ​ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  ​
  
Linia 33: Linia 36:
 info(X):- info(X):-
    ​jpl_datums_to_array(X,​Q),​    ​jpl_datums_to_array(X,​Q),​
-   ​jpl_new('​miw2.Info',​[Q],​D).+   ​jpl_new('​miw2.Info',​[Q],​_).
        
 myQuestion(Question,​Choices,​Response):​- myQuestion(Question,​Choices,​Response):​-
Linia 43: Linia 46:
  Response = V.  Response = V.
   
 +change(0,​y).
 +change(1,​n).
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
Linia 100: Linia 105:
 finish_xshell :- finish_xshell :-
      ​retractall(known(_,​_)),​      ​retractall(known(_,​_)),​
-%      writeline('​Do you want to conduct another consultation?'​),​ 
      ​yes(['​Do you want to conduct another consultation?'​]),​      ​yes(['​Do you want to conduct another consultation?'​]),​
      !,      !,
Linia 121: Linia 125:
  
 prop(Property) :- xkb_question(Property,​Question,​_,​_),​ prop(Property) :- xkb_question(Property,​Question,​_,​_),​
-                 % writeline(Question),​ 
    yes(Question),​    yes(Question),​
                   !,                   !,
Linia 149: Linia 152:
 parm(Parameter,​m,​Value) :- xkb_menu(Parameter,​Header,​Choices,​_),​ parm(Parameter,​m,​Value) :- xkb_menu(Parameter,​Header,​Choices,​_),​
                            ​length(Choices,​L),​                            ​length(Choices,​L),​
-                          % writeline(Header),​ 
-                          % enumerate(Choices,​1),​ 
   ​  ​myQuestion(Header,​Choices,​N),​   ​  ​myQuestion(Header,​Choices,​N),​
                            ​readnumber_in_range(1,​L,​N),​                            ​readnumber_in_range(1,​L,​N),​
Linia 160: Linia 161:
                       %     ​writeline(Question),​                       %     ​writeline(Question),​
         ​question(Response,​Question),​         ​question(Response,​Question),​
-                        %   ​readatom(Response), ​ 
                            ​assert(known(Parameter,​Response)),​                            ​assert(known(Parameter,​Response)),​
                            !,                            !,
Linia 166: Linia 166:
  
 parm(Parameter,​n,​Value) :- xkb_question(Parameter,​Question,​_,​_),​ parm(Parameter,​n,​Value) :- xkb_question(Parameter,​Question,​_,​_),​
-                      %     ​writeline(Question),​ 
-                      %     ​readnumber(Response),​ 
         ​question(Response,​Question),​         ​question(Response,​Question),​
                            ​assert(known(Parameter,​Response)),​                            ​assert(known(Parameter,​Response)),​
Linia 213: Linia 211:
     ​known(identification,​RULE),​     ​known(identification,​RULE),​
            ​clause(xkb_identify(RULE,​_),​Condition), ​              ​clause(xkb_identify(RULE,​_),​Condition), ​  
-    ​info(['Rule ', +    ​info([ 
-          ​RULE, +       ​   ​info([{RULE}])
-           '​: reach this conclusion IF']),+           '​Reach this conclusion IF']),
            ​explain_aux(Condition),​            ​explain_aux(Condition),​
            wait, !.            wait, !.
Linia 425: Linia 423:
                               xkb_text(N,​Text2),​                               xkb_text(N,​Text2),​
                               append(Text2,​Text1,​Text).                               append(Text2,​Text1,​Text).
- +</code>
-+
-% writeline(+Text) +
-%   ​Prints Text consisting of a string or a list of +
-%   ​strings,​ with each string followed by a new line. +
-+
- +
-% writeline([]) :- !. +
-% writeline([First|Rest]) :- +
-%        !, +
-%        info([First,​ +
-%        Rest]). +
-% writeline(String) :- +
-%        write(String),​ +
-%        . +
- +
- +
-</prolog>+
pl/miw/miw08_ruleruntimeg/xshell.1208854114.txt.gz · ostatnio zmienione: 2019/06/27 15:59 (edycja zewnętrzna)
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0