Skip to content

Commit

Permalink
Fixed Bug defaulting to FP default techniques
Browse files Browse the repository at this point in the history
  • Loading branch information
SudokuMonster committed Jan 1, 2020
1 parent bd74542 commit 4d5d558
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 33 deletions.
19 changes: 16 additions & 3 deletions diuf/sudoku/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ public class Settings {

public final static int VERSION = 1;
public final static int REVISION = 15;
public final static String SUBREV = ".8";
public final static String releaseDate = "2019-12-31";
public final static String releaseYear = "2019";
public final static String SUBREV = ".9";
public final static String releaseDate = "2020-01-01";
public final static String releaseYear = "2020";
public final static String releaseLicence = "Lesser General Public License";
public final static String releaseLicenceMini = "LGPL";
public final static String releaseLicenceVersion = "2.1";
Expand Down Expand Up @@ -434,6 +434,11 @@ public boolean isToroidal() {

public void setAntiFerz(boolean value) {
this.isAntiFerz = value;
if (value)
getInstance().setForbiddenPairs(true);
else
if (!(getInstance().isAntiKnight() || getInstance().whichNC() > 0))
getInstance().setForbiddenPairs(false);
toggleVariants();
save();
}
Expand All @@ -444,6 +449,11 @@ public boolean isAntiFerz() {

public void setAntiKnight(boolean value) {
this.isAntiKnight = value;
if (value)
getInstance().setForbiddenPairs(true);
else
if (!(getInstance().isAntiFerz() || getInstance().whichNC() > 0))
getInstance().setForbiddenPairs(false);
toggleVariants();
save();
}
Expand All @@ -466,6 +476,9 @@ public void setNC(int value) {
this.whichNC = value;
if (value > 0)
getInstance().setForbiddenPairs(true);
else
if (!(getInstance().isAntiFerz() || getInstance().isAntiKnight()))
getInstance().setForbiddenPairs(false);
toggleVariants();
save();
}
Expand Down
71 changes: 41 additions & 30 deletions diuf/sudoku/test/serate.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ static void help(int html) {
System.err.println(" [--revisedRating=N] [--threads=N] [--totalTime] [--batch=N]");
System.err.println(" [--isBlocks=N] [--isDG=N] [--isWindows=N] [--isX=N]");
System.err.println(" [--isGirandola=N] [--isAsterisk=N] [--isCD=N]");
System.err.println(" [--input=FILE] [--output=FILE] [--pearl] [--diamond] [puzzle ...]");
System.err.println(" [--isAntiKnight=N] [--isAntiKing=N] [--isToroidal=N] [--isNC=N]");
System.err.println(" [--input=FILE] [--output=FILE] [--pearl] [--diamond] [puzzle ...]");
System.err.println("");
System.err.println("DESCRIPTION");
System.err.println(" serate is a Sukaku Explainer command line entry point that rates one or more");
Expand All @@ -60,8 +61,20 @@ static void help(int html) {
System.err.println(" Format the output after each step according to FORMAT. Default is empty.");
System.err.println(" -b, --before=FORMAT");
System.err.println(" Format the output before each step according to FORMAT. Default is empty.");
System.err.println(" -B, --batch=N");
System.err.println(" Batch solving. Default 0=disabled.");
System.err.println(" 1=Apply all available hints that have the lowest rating");
System.err.println(" 2=Apply all available hints with rating lower than maximum puzzle rating");
System.err.println(" -c, --isNC=N");
System.err.println(" Control Non-Consecutive constraints 0: disable (default)");
System.err.println(" 1: NC (1,9 not included)");
System.err.println(" 2: NC+ (1,9 included)");
System.err.println(" -d, --diamond");
System.err.println(" Terminate rating if the puzzle is not a diamond.");
System.err.println(" -D, --isDG=N");
System.err.println(" Enable/disable Disjoint Group constraints. 0:disable (default), 1:enabled");
System.err.println(" -E, --isCD=N");
System.err.println(" Enable/disable Center Dot group constraints. 0:disable (default), 1:enabled");
System.err.println(" -f, --format=FORMAT");
System.err.println(" Format the output for each input puzzle according to FORMAT. Format");
System.err.println(" conversion are %CHARACTER; all other characters are output unchanged.");
Expand Down Expand Up @@ -95,62 +108,60 @@ static void help(int html) {
System.err.println(" %U The diamond rating technique shortened name. This is the SHORT name of technique with highest rating of the methods leading");
System.err.println(" to the first candidate elimination. (F)");
System.err.println(" %% The % character.");
System.err.println(" -G, --islkSudokuBUG=N");
System.err.println(" Fix to BUG algorithm by lkSudoku. 0=disabled 1=enabled (default)");
System.err.println(" -h, --html");
System.err.println(" List detailed info in html.");
System.err.println(" -i, --input=FILE");
System.err.println(" Read 81-character puzzle strings, one per line, from FILE. By default");
System.err.println(" operands are treated as 81-character puzzle strings. If no operands are");
System.err.println(" specified then the standard input is read.");
System.err.println(" -k, --isAntiKing=N");
System.err.println(" Enable/disable Anti-King constraints. 0:disable (default), 1:enabled");
System.err.println(" -K, --isAsterisk=N");
System.err.println(" Enable/disable Asterisk group constraints. 0:disable (default), 1:enabled");
System.err.println(" -m, --man");
System.err.println(" List detailed info in displayed man page form.");
System.err.println(" -n, --isAntiKnight=N");
System.err.println(" Enable/disable Anti-kNight constraints. 0:disable (default), 1:enabled");
System.err.println(" -N, --revisedRating=N");
System.err.println(" Revised rating scheme. Default 0=disabled. 1=enabled");
System.err.println(" -o, --output=FILE");
System.err.println(" Write output to FILE instead of the standard output.");
System.err.println(" -O, --isToroidal=N");
System.err.println(" Enable/disable Toroidal board. 0:disable (default), 1:enabled");
System.err.println(" -p, --pearl");
System.err.println(" Terminate rating if the puzzle is not a pearl.");
System.err.println(" -P, --FCPlus=N");
System.err.println(" Control non-trivial implications in FC+ and nested chains 0:default (similar to SE121)");
System.err.println(" 1:More techniques added");
System.err.println(" 2:More techniques added");
System.err.println(" -Q, --isBlocks=N");
System.err.println(" Enable/disable block(box) constraints. 0:disable (For Latin Square), 1:enabled (default)");
System.err.println(" -R, --isGirandola=N");
System.err.println(" Enable/disable Girandola group constraints. 0:disable (default), 1:enabled");
System.err.println(" -s, --start=FORMAT");
System.err.println(" Format the output before each puzzle according to FORMAT. Default is empty.");
System.err.println(" -S, --showArguments");
System.err.println(" Show parameters used");
System.err.println(" -t, --threads=N");
System.err.println(" Maximal degree of parallelism. Default 0=auto. 1=no parallelism; -1=unlimited");
System.err.println(" -N, --revisedRating=N");
System.err.println(" Revised rating scheme. Default 0=disabled. 1=enabled");
System.err.println(" -B, --batch=N");
System.err.println(" Batch solving. Default 0=disabled.");
System.err.println(" 1=Apply all available hints that have the lowest rating");
System.err.println(" 2=Apply all available hints with rating lower than maximum puzzle rating");
System.err.println(" -D, --isDG=N");
System.err.println(" Enable/disable Disjoint Group constraints. 0:disable (default), 1:enabled");
System.err.println(" -E, --isCD=N");
System.err.println(" Enable/disable Center Dot group constraints. 0:disable (default), 1:enabled");
System.err.println(" -G, --islkSudokuBUG=N");
System.err.println(" Fix to BUG algorithm by lkSudoku. 0=disabled 1=enabled (default)");
System.err.println(" -T, --totalTime");
System.err.println(" The time required to process all puzzles parsed to standard output");
System.err.println(" -U, --islkSudokuURUL=NAME");
System.err.println(" Fix to UR and UL algorithm by lkSudoku. 0=disabled 1=enabled (default)");
System.err.println(" -K, --isAsterisk=N");
System.err.println(" Enable/disable Asterisk group constraints. 0:disable (default), 1:enabled");
System.err.println(" -P, --FCPlus=N");
System.err.println(" Control non-trivial implications in FC+ and nested chains 0:default (similar to SE121)");
System.err.println(" 1:More techniques added");
System.err.println(" 2:More techniques added");
System.err.println(" -Q, --isBlocks=N");
System.err.println(" Enable/disable block(box) constraints. 0:disable (For Latin Square), 1:enabled (default)");
System.err.println(" Fix to UR and UL algorithm by lkSudoku. 0=disabled 1=enabled (default)");
System.err.println(" -~, --techs=TECHSTRING");
System.err.println(" Specific techniques only, set which techniques to use");
System.err.println(" the techniques string TECHSTRING is a string consisting of the letters '0' and '1',");
System.err.println(" where '1' means the technique should be used and '0' means it should not be used");
System.err.println(" To see which technique is in which letter, and how many techniques are");
System.err.println(" there, just type --techs= without any string after the = in TECHSTRING");
System.err.println(" -T, --totalTime");
System.err.println(" The time required to process all puzzles parsed to standard output");
System.err.println(" -R, --isGirandola=N");
System.err.println(" Enable/disable Girandola group constraints. 0:disable (default), 1:enabled");
System.err.println(" -S, --showArguments");
System.err.println(" Show parameters used");
System.err.println(" -V, --version");
System.err.println(" Print the Sudoku Explainer (serate) version and exit.");
System.err.println(" -W, --isWindows=N");
System.err.println(" Enable/disable Windows constraints. 0:disable (default), 1:enabled");
System.err.println(" Enable/disable Windows constraints. 0:disable (default), 1:enabled");
System.err.println(" -X, --isX=N");
System.err.println(" Enable/disable X diagonal constraints. 0:disable (default), 1:enabled");
System.err.println(" Enable/disable X diagonal constraints. 0:disable (default), 1:enabled");
System.err.println("");
System.err.println("INVOCATION");
System.err.println("");
Expand Down

0 comments on commit 4d5d558

Please sign in to comment.