JESS: simple calculation problem

2007-01-31 Thread M Ismail
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

JESS: how to get the rule text from a defrule

2007-01-31 Thread Skeptic 2000
Hi, With Jesp I can easily get the defrule of each of my rules in my .clp files and display their names in a Swing application. What I would like to do next is to display the actual text of the rule in this same application, can it be easily done ?Thanks. From: [EMAIL PROTECTED]

Re: JESS: simple calculation problem

2007-01-31 Thread Ernest Friedman-Hill
First, I don't know what ?s is. If it's a variable defined at the prompt, don't do that. It won't work reliably in Jess 6, and isn't even possible in Jess 7 (the fact that it's possible in Jess 6 is unintentional.) Otherwise, there's nothing wrong here, per se. Every time an update-

Re: JESS: how to get the rule text from a defrule

2007-01-31 Thread Ernest Friedman-Hill
Use the jess.PrettyPrinter class, as described in the manual. An aside: *please* start a new thread for your new questions; please don't reply to an existing message, whether or not you delete the old contents while editing your message, unless you're answering someone else's question. If

Re: JESS: is jess a declaritive language?

2007-01-31 Thread Ellen Zhao
Whether to apply the declarative or imperative programming paradigms really depends much on how data and behaviour should be bound together in your problem domain. When the relationship between data and behaviour is fairly weak and highly dynamic, DSLs with declarative syntax built upon rule

Re: JESS: simple calculation problem

2007-01-31 Thread Henrique Lopes Cardoso
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