Różnice
Różnice między wybraną wersją a wersją aktualną.
|
|
pl:prolog:pllib:interface [2019/06/27 15:50] |
pl:prolog:pllib:interface [2019/06/27 15:50] (aktualna) |
| ====== Interface ====== |
| {{tag>interactive}} |
| ===== Description ===== |
| The simplest version of ask prompts the user with the requested attribute and value and seeks confirmation or denial of the proposed information. |
| |
| **Source**: Building Expert Systems in PROLOG Publisher |
| ===== Download ===== |
| Program source code: {{interface.pl}} |
| ===== Listing ===== |
| <code prolog> |
| ask(Attr, Val):- |
| write(Attr:Val), |
| write('? '), |
| read(yes). |
| |
| eats(X):- ask(eats, X). |
| |
| feet(X):- ask(feet, X). |
| |
| wings(X):- ask(wings, X). |
| |
| neck(X):- ask(neck, X). |
| |
| color(X):- ask(color, X). |
| </code> |
| ===== Comments ===== |
| |