15 lines
524 B
Text
15 lines
524 B
Text
(deffacts count
|
|
(count-to 100))
|
|
|
|
(defrule print-numbers
|
|
(count-to ?max)
|
|
=>
|
|
(loop-for-count (?num ?max) do
|
|
(if (and (= (mod ?num 3) 0) (= (mod ?num 5) 0) ) then
|
|
(printout t "FizzBuzz" crlf)
|
|
else (if (= (mod ?num 3) 0) then
|
|
(printout t "Fizz" crlf)
|
|
else (if (= (mod ?num 5) 0) then
|
|
(printout t "Buzz" crlf)
|
|
else
|
|
(printout t ?num crlf))))))
|