Advertisement
Mitsanski

ES TK2

Jan 19th, 2022
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. (deftemplate weather
  2. (slot type))
  3.  
  4. (defrule GetWeatherType
  5. =>
  6. (printout t "What is the weather : ")
  7. (bind ?response (read))
  8. (assert (type ?response)))
  9.  
  10. (defrule Sunny
  11. (type sunny)
  12. =>
  13. (assert (weatherIs sunny))
  14. (printout t "The weather is nice and sunny!" crlf))
  15.  
  16. (defrule Cloudy
  17. (type cloudy)
  18. =>
  19. (assert (weatherIs cloudy))
  20. (printout t "The weather is cloudy and cold!" crlf))
  21.  
  22. (defrule Moody
  23. (type moody)
  24. =>
  25. (assert (weatherIs moody))
  26. (printout t "The weather is dark and looks like rain is coming!" crlf))
  27.  
  28. (reset)
  29. (run)
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement