Abstract:
A method and computer software are provided for making number place puzzles. Numbers and unknown are represented by variables that are assigned values such as in a plurality of nested loops. Instructions within each loop limit access to embedded loops until all assigned values form a valid solution. When some of the variables are pre-assigned values to create a number place puzzle, the output will be all valid solutions, if any. Multiple solutions provide information that assists in modifying the pre-assigned values to obtain a single solution.

Description:
CROSS-REFERENCE TO RELATED APPLICATIONS 
       [0001]    This application is a continuation application of co-pending U.S. patent application Ser. No. 12/615,199 (Attorney Docket No. TACK/0003), filed on Nov. 9, 2009, which is herein incorporated by reference. 
         [0002]    This application includes a computer program listing, submitted electronically as a txt file named NP.txt, incorporated by reference herein. 
     
    
     BACKGROUND OF THE INVENTION 
       [0003]    1. Field of the Invention 
         [0004]    This application relates to methods and computer software for creating games, such as creating puzzles. 
         [0005]    2. Description of the Related Art 
         [0006]    Number place puzzles are readily available in the market place although little or no information if available regarding how the puzzles were created. Software that assists with solving number place puzzles is also available although software that actually solves the puzzles is not widely distributed if available. Of course, software that can solve number place puzzles would be most valuable in creating number place puzzles. 
         [0007]    The absence of software to create number place puzzles indicates a need for public disclosure of a suitable method and software for making number place puzzles to promote development of useful arts. 
       SUMMARY OF THE INVENTION 
       [0008]    A method and computer software are provided for making number place puzzles. Numbers and unknowns are represented by variables that are assigned values such as by a plurality of nested loops. Instructions within each loop limit access to embedded loops until all assigned values form a valid solution. When some of the variables are pre-assigned all known values from a number place puzzle having only one solution, the output of the software would be the solution of the puzzle. However, when the variables are pre-assigned values while creating a number place puzzle, the software output will be all valid solutions, if any. Multiple solutions provide information that assists in modifying the pre-assigned values to obtain a single solution. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0009]    So that the manner in which the above-recited features of the present invention can be understood in detail, a more particular description of the invention, briefly summarized above, may be had by reference to embodiments, some of which are illustrated in the appended drawings. It is to be noted, however, that the appended drawings illustrate only typical embodiments of this invention and are therefore not to be considered limiting of its scope, for the invention may admit to other equally effective embodiments. 
           [0010]      FIG. 1  shows a sample of pre-assigned values used to illustrate the method and software of an embodiment of the present invention. 
           [0011]      FIG. 2  shows a flow diagram of a computer program embodiment having nested loops for use in a method embodiment of the present invention. 
           [0012]      FIG. 3  shows lines of a computer program that correspond to portions of the flow diagram in  FIG. 2 . 
           [0013]      FIG. 4  shows additional lines of the computer program of  FIG. 3 . 
           [0014]      FIG. 5  shows the results of running the computer program of  FIGS. 3 and 4 . 
           [0015]      FIG. 6  shows two separate number place puzzles created from the results shown in  FIG. 5 . 
       
    
    
       [0016]    To facilitate understanding, identical reference numerals have been used, where possible, to designate identical elements that are common to the figures. It is contemplated that elements disclosed in one embodiment may be beneficially utilized on other embodiments without specific recitation. 
       DETAILED DESCRIPTION 
       [0017]      FIG. 1  shows a number place puzzle having a 9×9 array of boxes typically used in classic Sudoku™ puzzles. The array forms 9 rows of 9 boxes labeled A through F and 9 columns of 9 boxes labeled  1  through  9 . Pre-assigned values have been selected to illustrate making a number place puzzle. The values can be pre-assigned in any manner as long as the rules of the number place puzzle are obeyed, e.g. each row, column, and nonet (3×3 array) has no duplicate numbers for a classic Sudoku™ puzzle. The values can be pre-assigned before the program is executed as shown in the following Figures. Alternatively, the program can assist in selecting variables using graphics and dropdown windows. 
         [0018]    Each box in the example puzzle of  FIG. 1  is readily identified by the row and column, e.g. box A 1  is preset at 1. For use in the following description, each nonet in  FIG. 1  is labeled in the top center boxes N 1 , N 2 , N 3 , N 4 , N 5 , N 6 , N 7 , N 8 , and N 9 . The selection of pre-assigned values in  FIG. 1  was assisted by the computer program listing (NP.txt) filed with this application although selection can be done manually. 
         [0019]      FIG. 2  shows a diagram of a computer program for making number place puzzles according to an embodiment of the present invention. The source code for one such program written in BASIC is shown in the computer program listed. The BASIC program was written using JUSTBASIC 1.01 which is freeware available at www.justbasic.com. The attached BASIC program is not free for use in making number place programs if one or more claims below are granted. The computer program can be written in any program language and for any number place puzzle. 
         [0020]    The embodiment shown in  FIG. 2  uses eighty-one (81) nested loops to assign each of the eighty-one (81) variables in the 9×9 number place puzzle of  FIG. 1  as described in more detail for  FIG. 4 . Pre-assigned values are entered  21  and are processed by limiting selection of each variable to the corresponding pre-assigned value as described in more detail for  FIG. 3 . After a value is selected for each variable, such as selection of a value for A 1   22 , the value is compared  23  to relevant pre-assigned values and relevant values previously assigned to the variables by the nested loops. The value is not compared to variables that are to be assigned in any loops that are embedded in the loop that assigned the value because the embedded variables are not yet assigned a value for comparison. However, comparison of the value to embedded variables will occur when each embedded variable is subsequently assigned a value. 
         [0021]    When the selected value for a variable is the same as a compared value, embedded loops are bypassed  24  for selection of another value for the same variable. If the selected value if different from all compared values, the value of the next variable is selected, such as selection of A 2   25 . The selection of successive variables continues as long as each new value satisfies the comparisons. When no value satisfies the comparisons for a variable, processing returns to selection of the prior variable, e.g. selection of A 2  exits  26  to selection of another value for A 1 . 
         [0022]    When all selected variables satisfy the comparisons, the variables are printed  27 . Thus, the comparison instructions within each loop limit access to successive loops that would print the variables. The computer program ends  28  after the possible combinations of the variables have been tested, such that all possible solutions are printed absent limitation on the number of printed solutions. When the computer program listing (NP.txt) is executed with JUSTBASIC 1.01, up to 50 solutions (when NPMAX=50) are printed to a window and can be saved in a file or printed. 
         [0023]      FIG. 3  shows lines from the computer program listing which illustrate entry of pre-assigned values  31 , limitation of variables from A 1  to F 9  to any preset value  32 , and selection of variables from A 1  to F 6   33  using For/Next statements. In the computer program listing, selection of variables begins with N 1  of  FIG. 1  and progresses through N 6 , N 8 , N 2 , N 4 , N 9 , N 3 , N 7 , and N 5 . The order of the nonets for selection of values was chosen to assist in writing the program by having a sequence wherein selected values in Nonet  1  in  FIG. 2  (N 1 ) were not comparable to values in Nonet  2  (N 6 ) or Nonet  3  (N 8 ) and selected values in Nonet  4  (N 2 ) were not comparable to values in Nonet  5  (N 4 ) or Nonet  6  (N 9 ). The same result would be achieved by similar sequences such as the reverse sequence N 5 , N 7 , N 3 , N 9 , N 4 , N 2 , N 8 , N 6 , and N 1 . 
         [0024]    After successful selection of all variables without duplicates, the computer program listing prints a header  34  that keeps count of the solutions and prints all variables  35 . When a variable such as A 1  of F 6  is a duplicate to a pre-assigned value or a previously selected value, processing jumps to a label positioned before the corresponding Next statement  36 . After all combinations are processed, the final commands print “End”  37  to show that processing is completed unless the program terminated by setting NPMAX to a number less than the number of solutions. 
         [0025]      FIG. 4  shows additional lines from the computer program listing to illustrate how comparison of variables is completed for N 1  and N 4  in  FIG. 1 . For each variable, the selected value is compared to pre-assigned values and previously selected values in the same row  41 , pre-assigned values and previously selected values in the same column  42 , and then pre-assigned values and previously selected values for remaining boxes in the same nonet  43 . As shown in  FIG. 4 , subsequent comparisons  45 ,  45 ,  46  include more previously selected values and fewer pre-assigned values than the prior comparisons because the previously selected values would be identical to any pre-assigned value for the same variable. 
         [0026]    When multiple solutions are obtained, further pre-assignment of values may be assisted by comparing the multiple solutions. For example, the pre-assigned values shown in  FIG. 1  have the four solutions shown in  FIG. 5  (which shows the result of executing the computer program listing NP.txt filed with this application). Comparing the solutions, only Solution  1  has a value of 2 at A 6   51  and a value of 6 at I 4   52 , thus pre-assignment of both values would result in a single solution for the corresponding puzzle  61  shown in  FIG. 6 . Similarly pre-assignment of both A 6   53  and I 4   54  in Solution  2  would result in a single solution. Assignment of I 7  in Solution  1  or assignment of I 7  in Solution  4  would also result in unique solutions although less symmetrical. 
         [0027]    Puzzles having a single solution can be modified to be more symmetrical as shown in  FIG. 6 . The puzzle  61  created in the description above was modified by removing the pre-assigned values for F 4  and D 6 . Execution of the computer program listing (NP.txt) after modification resulted in  26  solutions and only the first solution resulted in the value 8 for E 5 . Thus, a more symmetrical puzzle  62  was obtained by pre-assigning the value 8 to E 5 . Whenever no solution remains, removal of one pre-assigned value can also result in a single solution or a different set of multiple solutions that can be examined for a single solution. 
         [0028]    While the foregoing is directed to embodiments of the invention, other and further embodiments of the invention may be devised without departing from the basic scope thereof.