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 <http://ctat.pact.cs.cmu.edu/> > , 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 > ?prob <- (problem > (interface-elements $? > ?grid $?)) > ?grid <- (grid (rows $? ?row $?)) > ?row <- (row (cells $? ?cell $?)) > ?cell <- (cell > (name ?name) > (value nil) > (row-number ?row-num)) > ?cell2 <- (cell > (value ?number&~nil) > (row-number ?row-num2)) > (test (= ?row-num ?row-num2)) > => > (predict ?name UpdateTextField ?number) > (construct-message > "[The row already has a > "?number".]") > ) -- View this message in context: http://jess.2305737.n4.nabble.com/Limit-on-number-of-rules-tried-tp4654204p4654205.html Sent from the Jess mailing list archive at Nabble.com.