My apologies for the lousy formatting of my original message. Please see
properly formatted version below.

northparkjamie wrote
> Hi, can you please help me?
> I'm relatively new to Jess (and using it with 
> CTAT <>  
> , so my question may need to be redirected to them).
> I am trying to build a sudoku tutor (just to improve my skills) and I'm
> having a problem with my very first rule (below). This rule fires if one
> cell is empty and another in the same row is not. On the RHS, the predict
> function (from CTAT) checks whether the number entered by the user into
> the first cell is the same as the number in the second cell. If it is the
> same, the construct-message function displays the given message. If it is
> different, anything that has happened on the RHS is or remains undone. For
> example, if the row is {nil nil 6 nil nil nil 2 3 nil} and the user enters
> 6 in any of the nil cells, the rule should fire and the predict should
> match and the message should be shown. But, if the user enters 8, the rule
> should still fire, but the predict function should fail, so nothing should
> happen.
> If I test this rule on the first row of the 9x9 grid, it behaves as
> expected. But if I test it on any other row, the engine only tries it 20
> times and never finds the cell in which the input was placed.
> Is there something in Jess that is limiting the number of trials or should
> I be talking to the CTAT people? If it is Jess, is there a way I can
> modify this limitation?
> Thanks in advance for your time and wisdom,
> Jamie
> (defrule bug-num-is-in-row 
> &nbsp;&nbsp;&nbsp;&nbsp;?prob <- (problem 
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(interface-elements $?
> ?grid $?))
> &nbsp;&nbsp;&nbsp;&nbsp;?grid <- (grid (rows $? ?row $?))
> &nbsp;&nbsp;&nbsp;&nbsp;?row <- (row (cells $? ?cell $?))
> &nbsp;&nbsp;&nbsp;&nbsp;?cell <- (cell 
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(name ?name)
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(value nil)
> &nbsp;&nbsp;&nbsp;&nbsp;(row-number ?row-num))
> &nbsp;&nbsp;&nbsp;&nbsp;?cell2 <- (cell 
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(value ?number&~nil)
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(row-number ?row-num2))
> &nbsp;&nbsp;&nbsp;&nbsp;(test (= ?row-num ?row-num2))
> &nbsp;&nbsp;&nbsp;&nbsp;=>
> &nbsp;&nbsp;&nbsp;&nbsp;(predict ?name UpdateTextField ?number)
> &nbsp;&nbsp;&nbsp;&nbsp;(construct-message 
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"[The row already has a
> "?number".]")
> &nbsp;&nbsp;&nbsp;&nbsp;)

View this message in context:
Sent from the Jess mailing list archive at

Reply via email to