noz


deffunction MAIN::logo
(?q1 ?q2 ?q3 ?q4)
(printout t --------------------- crlf
" -| " ?q1 crlf
" / | " ?q2 crlf
" _|_|_ " ?q3 crlf
" (_) " ?q4 crlf))

(deffunction MAIN::linia
(?i ?j)
(if (eq ?i 1)
then
(printout t "*********************************" crlf)))

(deffunction MAIN::liniaEr
(?i ?j)
(if (eq ?i 1)
then
(printout t "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" crlf)))

(deffunction MAIN::liniaSt
(?i ?j)
(if (eq ?i 1)
then
(printout t "---------------------------------" crlf)))

(defrule MAIN::start
=>
(linia 1 0)
(logo " Witam!" " To jest system" " pomocy przy wyborze noza" " zaczynamy ? (t/n)")
(linia 1 0)
(printout t crlf)
(assert (start (read)))
(printout t crlf))

(defrule MAIN::koniec
(start n)
=>
(printout t crlf)
(printout t "Zapraszam ponownie!" crlf))

(defrule MAIN::pyt1
(start t)
=>
(liniaSt 1 0)
(printout t "Jestes zainteresowany zakupem noza mysliwskiego czy skladanego ? (m/sk)" crlf)
(linia 1 1)
(assert (pyt1 (read))))

(defrule MAIN::cena
(start t)
(pyt1 m)
(or (marka g)
(marka e)
(marka m))
=>
(liniaSt 1 0)
(printout t "Jaka kwote chcesz przeznaczyc na zakup noza ? (podaj kwote w zlotowkach np. 10)" crlf)
(linia 1 0)
(assert (kwota (read)))
(printout t crlf))

(defrule MAIN::zamkniecie
(start t)
(pyt1 sk)
=>
(liniaSt 1 0)
(printout t "Jaki rodzaj sposob zamkniecia ?" crlf)
(linia 1 0)
(printout t "1 - linerlock" crlf)
(printout t "2 - axislock" crlf)
(printout t "3 - backlock" crlf)
(assert (zamkniecie (read)))
(printout t crlf))

(defrule MAIN::wynik1
(start t)
(pyt1 sk)
(zamkniecie 1)
=>
(linia 1 0)
(printout t "Proponowany noz to benchmade 710" crlf)
(linia 1 0))

(defrule MAIN::wynik2
(start t)
(pyt1 sk)
(zamkniecie 2)
=>
(linia 1 0)
(printout t "Proponowane noz to benchmade 810" crlf)
(linia 1 0))

(defrule MAIN::wynik3
(start t)
(pyt1 sk)
(zamkniecie 3)
=>
(linia 1 0)
(printout t "Proponowane noz to benchmade vex 10710" crlf)
(linia 1 0))

(defrule MAIN::blad
(start t)
(pyt1 sk)
(not (zamkniecie 1))
(not (zamkniecie 2))
(not (zamkniecie 3))
=>
(liniaEr 1 1)
(printout t "Nie ma takiej odpowiedzi. Uruchom program jeszcze raz." crlf)
(liniaEr 1 1))

(defrule MAIN::marka
(start t)
(pyt1 m)
=>
(printout t "Jaka firma produkujaca noze Cie interesuje ?" crlf)
(liniaSt 1 1)
(printout t crlf)
(printout t "g - Ganzo" crlf)
(printout t "e - Enlan" crlf)
(printout t "m - Mtech" crlf)
(linia 1 1)
(assert (marka (read)))
(printout t crlf))



(defrule MAIN::blad1
(start t)
(pyt1 m)
(not (marka g))
(not (marka e))
(not (marka m))
=>
(liniaEr 1 0)
(printout t "Nie posiadamy takiej marki w naszym systemie. Rozpocznij program jeszcze raz." crlf)
(liniaEr 1 0))

(defrule MAIN::noz1
(start t)
(pyt1 m)
(marka g)
(kwota ?hajs)
=>
(liniaSt 1 0)
(if (<= ?hajs 15)
then
(printout t "Nie mamy nozy tej marki ponizej 15 zl" crlf))
(if (> ?hajs 15)
then
(printout t "Proponowany noz to ganzo 710 za 19 zl." crlf))
(if (>= ?hajs 20)
then
(printout t "Proponowany noz to ganzo 725 za 33 zl." crlf))
(if (>= ?hajs 45)
then
(printout t "Proponowany noz to ganzo 845 za 55 zl." crlf))
(if (>= ?hajs 60)
then (printout t "najdrozszy nasz noz kosztuje 90zl" crlf))
(printout t crlf)
(liniaSt 1 1)
(printout t "Czy jestes zainteresowany dokupienie pochwy na noz ? (t/n)" crlf)
(linia 1 1)
(assert (pyt2 (read)))
(printout t crlf))

(defrule MAIN::noz2
(start t)
(pyt1 m)
(marka e)
(kwota ?hajs)
=>
(liniaSt 1 0)
(if (<= ?hajs 15)
then
(printout t "Nie mamy nozy tej marki ponizej 15 zl." crlf))
(if (> ?hajs 15)
then
(printout t "Proponowany noz to enlan el-01 za 17 zl." crlf))
(if (>= ?hajs 20)
then
(printout t "Proponowany noz to enlan el-03 za 30 zl." crlf))
(if (>= ?hajs 45)
then
(printout t "Proponowany noz to enlan el-05 za 50 zl." crlf))
(if (>= ?hajs 60)
then
(printout t "najdrozszy nasz noz kosztuje 70zl" crlf))
(printout t crlf)
(liniaSt 1 1)
(printout t "Czy jestes zainteresowany dokupienie pochwy na noz ? (t/n)" crlf)
(linia 1 1)
(assert (pyt2 (read)))
(printout t crlf))

(defrule MAIN::noz3
(start t)
(pyt1 m)
(marka m)
(kwota ?hajs)
=>
(liniaSt 1 0)
(if (<= ?hajs 15)
then
(printout t "Nie mamy nozy tej marki ponizej 15 zl." crlf))
(if (> ?hajs 15)
then
(printout t "Proponowany noz to mtech classic za 19 zl." crlf))
(if (>= ?hajs 20)
then
(printout t "Proponowany noz to mtech bolo za 31 zl." crlf))
(if (>= ?hajs 45)
then
(printout t "Proponowany noz to mtech machete za 52 zl." crlf))
(if (>= ?hajs 60)
then
(printout t "najdrozszy nasz noz kosztuje 80zl" crlf))
(printout t crlf)
(liniaSt 1 1)
(printout t "Czy jestes zainteresowany dokupienie pochwy na noz ? (t/n)" crlf)
(linia 1 1)
(assert (pyt2 (read)))
(printout t crlf))

(defrule MAIN::pyt2n
(start t)
(pyt1 m)
(or (marka g)
(marka e)
(marka m))
(kwota ?hajs)
(pyt2 n)
=>
(linia 1 1)
(printout t "Do zobaczenia!" crlf)
(linia 1 1))

(defrule MAIN::pyt2t
(start t)
(pyt1 m)
(or (marka g)
(marka e)
(marka m))
(kwota ?hajs)
(pyt2 t)
=>
(liniaSt 1 1)
(bind ?rata (/ ?hajs 2))
(printout t "pochwa kosztuje ok " (round ?rata) " zl" crlf)

(printout t "Do zobaczenia !" crlf)
(linia 1 1))

(defrule MAIN::pyt2blad
(start t)
(pyt1 m)
(or (marka g)
(marka e)
(marka m))
(kwota ?hajs)
(not (pyt2 t))
(not (pyt2 n))
=>
(liniaEr 1 0)
(printout t "Bledna wartosc, uruchom program jeszcze raz" crlf)
(liniaEr 1 0))



Wyszukiwarka

Podobne podstrony:
Manau?st Noz? Paname
Jak naostrzyć nóż
002 Wybieramy nóż poradnik
Nóż w plecy
04 NoZ organizowanieidQ15
Wodny noz Paolo Bacigalupi 2
05 NoZ przewodzenie kierowanieidW64
noz
Komeda noz w wodzie 3
Ćwiczenie Nóż świetlny
nóż tokarski
noz
Komeda noz w wodzie 4
calka noz

więcej podobnych podstron