Hi,

I guess you should retract the update-scores fact in the rhs of the update-scores rule, otherwise you will not be able to assert a new update-scores fact (and therefore the update-scores rule will not fire again).

Henrique

M Ismail wrote:
hi,

im trying to add a number to another number which keeps increasing on every rule

that is what i have:

(defrule fight
(object knife)
  =>
(assert (Fight))
(assert (update-scores 10))
(printout t "Fight !" crlf)
)

(defrule update-scores
  (update-scores ?c)
  =>
 (call ?s setAgr (+ (call ?s getAgr) ?c)))

and i want it to be something like:
score starts with 0

and when rule fight is fire then it should add 10 so the final score is 10

and if another rule is fired it will add also 10 and then the final score is 20 etc...

how can i do that?  what i have  now is just replacing and not adding

best regards,

m.ismail

_________________________________________________________________
Veilig & gerust mailen met de verbeterde antivirusscan van Live Mail! http://imagine-windowslive.com/mail/launch/default.aspx?Locale=nl-nl

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------



--
----- - - - - -  -  -  -  -  -   -   -
Henrique Lopes Cardoso
DEEC/FEUP
Rua Dr. Roberto Frias | 4200-465 Porto
PORTUGAL
(+351)225081400 ext.1315
[EMAIL PROTECTED] | www.fe.up.pt/~hlc
----- - - - - -  -  -  -  -  -   -   -

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to