From 56f9efba1d5d54133eaac93025ee5fa779d3f8b3 Mon Sep 17 00:00:00 2001 From: ryuga4 Date: Mon, 3 Jun 2019 22:56:51 +0200 Subject: [PATCH] v2 --- expert.pl | 177 ++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 119 insertions(+), 58 deletions(-) diff --git a/expert.pl b/expert.pl index ba94118..9ce55fa 100644 --- a/expert.pl +++ b/expert.pl @@ -10,7 +10,11 @@ pref(P,X) :- ; Y = cokolwiek). pref(P,X) :- - format("~w:\n", [P]), + znajdzPCechy(P,XS), + format("wybierz ~w\n", [P]), + format("do wyboru masz:\n"), + forall(member(I,XS), format("- ~w\n",[I])), + format("- cokolwiek\n"), read(Y), nb_setval(P,Y), ( Y = X @@ -24,7 +28,7 @@ prefb(P,X) :- Y=X. prefb(P,X) :- - format("~w?\n",[P]), + format("~w? (tak lub nie)\n",[P]), read(Y), nb_setval(P,Y), Y = X. @@ -40,7 +44,12 @@ termin(XS) :- !. termin(XS) :- - format("termin (od-do):\n"), + + format("wybierz termin jaki ci odpowiada\n"), + format("przykladowo:\n"), + format("3-5 (dowolny miesiac od marca do maja)\n"), + format("nie(3-5) (dowolny miesiac nie bedacy miedzy marcem a majem)\n"), + read(Y), nb_setval(termin,Y), member(X,XS), @@ -50,79 +59,131 @@ termin(XS) :- !. -cena(X) :- - nb_current(cena,_), - nb_getval(cena,Y), +ilosc(X) :- + nb_current(ilosc,_), + nb_getval(ilosc,I), !, - X=