<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
Anyone want to take this on?<br>
<br>
Mark<br>
<br>
-------- Original Message --------
<table class="moz-email-headers-table" border="0" cellpadding="0"
 cellspacing="0">
  <tbody>
    <tr>
      <th align="right" nowrap="nowrap" valign="baseline">Subject: </th>
      <td>Unsolicited "Improvements" to the sudoku example</td>
    </tr>
    <tr>
      <th align="right" nowrap="nowrap" valign="baseline">Date: </th>
      <td>Thu, 6 Nov 2008 04:17:31 +0000 (UTC)</td>
    </tr>
    <tr>
      <th align="right" nowrap="nowrap" valign="baseline">From: </th>
      <td><a class="moz-txt-link-abbreviated" href="mailto:ted.keenan@comcast.net">ted.keenan@comcast.net</a></td>
    </tr>
    <tr>
      <th align="right" nowrap="nowrap" valign="baseline">To: </th>
      <td><a class="moz-txt-link-abbreviated" href="mailto:mark.proctor@jboss.com">mark.proctor@jboss.com</a></td>
    </tr>
  </tbody>
</table>
<br>
<br>
<p class="MsoNormal">To Whom It May Concern:</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Here is an unsolicited patch that addresses some
to do items
in the Sudoku example:</p>
<ol style="margin-top: 0in;" start="1" type="1">
  <li class="MsoNormal" style="">The patch combines the two drl files
into a single file, sudokuSolverValidatorWithGuess.drl, and separates
them by using agenda groups. </li>
  <li class="MsoNormal" style="">It simplifies the checking of whether
all possible cells have a solution by creating an object, basecell, for
each cell that needs a resolved cell and introduces it into the memory
space. A rule then checks baseCells against resolvedCellValues for the
memory set.</li>
  <li class="MsoNormal" style="">Changes the way issues are raised by
removing the issues array and adding various types of
SudokuStatusMessages so that the status of the solution can be tracked
by a separate status listener. This allows the model to track the
status of solution.</li>
  <li class="MsoNormal" style="">Provides a solution to the rule 11
guessing rule. This is a little complex as the process is to identify a
cell with multiple possible values and pick one of them and then run a
copy of the solver to its logical conclusion and identify the result
which is one of the following: solved, in error or indeterminate. The
process is repeated until a solved solution is identified. <br>
Each pass keeps tracks the removal and insertion of memory facts so
that they can be reversed at the end of the logical test. At the end of
each test the effects of the test are reversed and one of the following
is done depending on the result. If the test is indeterminate; keep
testing. If the solution is solved; set the guessed cell value pair as
the only possible value for the cell and run the base testing routines.
If the solution is logically inconsistent; remove the cell value as a
possibleCellValue, if this leaves only one possibleCellValue then run
the base testing routines. <br>
Note, the error cases don’t necessarily solve the puzzle the end so
sometimes you need to guess multiple times.</li>
  <li>Changed the constants and samples into a strategy pattern that
can support 4x4 and 6x6 grids as well as the 9x9 grid. This was done to
simplify testing as it is easier to test an indeterminate 4x4 grid then
a hard 9x9 grid when guessing.</li>
</ol>
Note: the samples for 4x4 and 6x6 have indeterminate examples which can
end up in multiple solutions. The 4x4 grid can reverse the values 1 and
3 depending order of resolution. The 6x6 can display various behavior,
including solving a subset of the puzzle in one step and eliminating
only one possible cell for several guesses before hitting on a solution.<br>
<br>
<div>I hope this helps. </div>
<br>
<div>Ted Keenan<br>
 <br>
</div>
</body>
</html>