                        SUDOKU for the CPC 6128
                        -----------------------

          1.  Data input  to  "Sudoku"  is at  lines  1050  et seq.The
program starts by showing  a  vertical  check  to  ensure that data is
correctly entered. It works by  first  listing all possible values for
unknown numbers, i.e. those values  which  do  not occur in a relevant
row, column or box. They are identified  by nnl$(x,y) where "x" is the
horizontal row and "y" is the  vertical column. 3X3 boxes are labelled
a to i.

         2.  It then  looks  for  any  nnl$  which  only  has a single
possible value (called "unique" in  the  program). This is transferred
to  the correct place in  the  data   (identified as d$(x,y))  and  it
looks for  this  value  in  the  relevant  row,  column  and  box  and
eliminates any from the corresponding nnl$. If there has been a unique
number it goes back to the start of  this Paragraph 2 and this goes on
till there are no more unique numbers.

        3.  It then looks  at  each  row  in  turn  to find any single
number, transfers this  to  d$  and  eliminates  it  from any relevant
column or box. It  then  looks  at  each  column  in turn with similar
actions and then each box in turn.  After this it returns to Paragraph
2 and strts again. In most  cases  this will eventually  print out the
final answer in fifteen minutes or so.


       4. However, in some  "diabolical"  puzzles, it  cannot find any
more "unique" or  singles.  It then prints out  (on  paper) a table of
calculated numbers in the data and  lists  all nnl$'s which have  only
two  possibles.   All  calculated  numbers  should be  inserted in the
original data.

       5.One  then selects one number from  a pair in an nnl$,inserts
it in the data and restarts the program.

       If that number is incorrect, the  program  will stop with a "no
possible..."statement. The other number  of  the  pair  is correct and
should be inserted in the  data.  Then  select another pair and repeat
Paragraph 5.

          If the number selected from the pair is correct, the program
will  print    "no more singles".     The  number  can  be left in the
data.. Insert any new numbers in  the  data. Then select a number from
another pair in the latest list and repeat Paragraph 5 until the final
solution is achieved. This usually happens within about three runs.

     Very occasionally, the program will stop with neither of the pair
shown as possible.  This  is  because  all possibles have been deleted
while the program goes through all  the rows, columns and boxes before
returning to check for  "uniques".  Program  "Longsud" is designed for
this eventuality. (It is very similar to  "Sudoku" but takes longer to
run). After a single is found in any  row, column or box it returns to
check for "uniques" and then  goes  back  to  look for singles in rows
etc. Input to "Longsud" is also at lines 1050 et seq.


               There is  much  superfluous  material  in  "Sudoku" and
"Longsud".  This is  because  they  were developed  from  the  program
"Grid". This program prints out  on  paper  all the possible values at
every location. Input is at lines  1050  et  seq. Four solid lines are
needed on the print to separate the 3X3 boxes.


Revision 2. 23/5/06.
