Skip to content

Commit

Permalink
Merge pull request #33 from SudokuMonster/Cosmetic-changes-to-v1.3.0.0
Browse files Browse the repository at this point in the history
Cosmetic changes up to v1.3.0.0
  • Loading branch information
SudokuMonster authored Aug 24, 2019
2 parents dcafd41 + c50111e commit 152fba0
Show file tree
Hide file tree
Showing 3 changed files with 139 additions and 92 deletions.
104 changes: 59 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,10 @@ Visit the [releases page](https://github.com/SudokuMonster/SukakuExplainer/relea

serate - Sukaku and Sudoku Explainer command line rating

hints - Sukaku and Sudoku Explainer hints display

pencilmarks - Sukaku and Sudoku Pencilmark display

### SYNOPSIS

serate [--diamond] [--format=FORMAT] [--input=FILE] [--output=FILE] [--pearl] [puzzle ...]

hints [--input=FILE]

pencilmarks [--input=FILE]
serate [--diamond] [--after=FORMAT] [--before=FORMAT] [--format=FORMAT]
[--input=FILE] [--output=FILE] [--pearl] [--start=FORMAT] [--threads=N] [puzzle ...]

### DESCRIPTION

Expand Down Expand Up @@ -55,6 +48,14 @@ Visit the [releases page](https://github.com/SudokuMonster/SukakuExplainer/relea

### OPTIONS (serate)

-a, --after=FORMAT

Format the output after each step according to FORMAT. Default is empty.

-b, --before=FORMAT

Format the output before each step according to FORMAT. Default is empty.

-d, --diamond

Terminate rating if the puzzle is not a diamond.
Expand All @@ -69,21 +70,35 @@ Visit the [releases page](https://github.com/SudokuMonster/SukakuExplainer/relea

%d The diamond rating. This is the highest ER of the methods leading

to the first candidate elimination.
to the first candidate elimination. (F)

%e The elapsed time to rate the puzzle.
%e The elapsed time to rate the puzzle. (AF)

%g The puzzle grid in 81-character [0-9] form.
%h The long step description in multi-line HTML format. (A)

%n The input puzzle ordinal, counting from 1.
%g The input puzzle line. (SBAF)

%i The puzzle grid in 81-character [0-9] form. (SBAF)

%l The new line. (SBAF)

%m The input puzzle pencilmarks in 729-char format. (SBA)

%M The input puzzle pencilmarks in multi-line format. (SBA)

%n The input puzzle ordinal, counting from 1. (SF)

%p The pearl rating. This is the highest ER of the methods leading

to the first cell placement.
to the first cell placement. (F)

%r The puzzle rating. This is the highest ER of the methods leading

to the puzzle solution.
to the puzzle solution. (AF)

%s The short step description. (A)

%t The tab character. (SBAF)

%% The % character.

Expand Down Expand Up @@ -111,6 +126,14 @@ Visit the [releases page](https://github.com/SudokuMonster/SukakuExplainer/relea

Terminate rating if the puzzle is not a pearl.

-s, --start=FORMAT

Format the output before each puzzle according to FORMAT. Default is empty.

-t, --threads

Maximal degree of parrallelism. Default 0=auto. 1=no parallelism; -1=unlimited

-V, --version

Print the Sudoku Explainer (serate) version and exit.
Expand All @@ -125,46 +148,37 @@ Visit the [releases page](https://github.com/SudokuMonster/SukakuExplainer/relea

java.exe -Xrs -Xmx500m -cp SukakuExplainer.jar diuf.sudoku.test.serate ...

Display Hints:

java.exe -Xrs -Xmx500m -cp SukakuExplainer.jar diuf.sudoku.test.hints ...

Display Pencilmarks:

java.exe -Xrs -Xmx500m -cp SukakuExplainer.jar diuf.sudoku.test.pencilmarks ...

### GUI

Functionality is retained with vanilla sudoku puzzles
Functionality is retained with vanilla sudoku puzzles. It also accepts parsing any
Pencilmark grid or Sukaku

With Pencilmark (sukaku) puzzles functionality is currently limited to "Get next hint" and "Apply hint"

With Pencilmark (sukaku) puzzles the validity check currently will assume puzzle has multiple solutions.

Paste Grid (Ctrl+V) currently allows parsing the following only:
```
Pencilmark grid
729-character line representation of Pencilmark (Sukaku) grid
81-character line represtation of a vanilla sudoku grid
Sudoku grid: only in a multi line format consisting of 81 consecutive characters
```

### EXAMPLES
### Examples

Note: % must be entered as %% in windows .bat files and shortcut commands.

To rate a single or a group of puzzle(s):

java.exe -Xrs -Xmx500m -cp SukakuExplainer.jar diuf.sudoku.test.serate
--format="%g ED=%r/%p/%d" --input=puzzles.txt --output=puzzles.rated.txt

To display explainer hints (output is to standard output):

java.exe -Xrs -Xmx500m -cp SukakuExplainer.jar diuf.sudoku.test.hints --input=puzzle.txt

To display explainer pencilmarks (output is to standard output):

java.exe -Xrs -Xmx500m -cp SukakuExplainer.jar diuf.sudoku.test.pencilmarks --input=puzzle.txt
To display all supported format parameters (at the time of writing this document):

java -Xrs -Xmx1g -cp SukakuExplainer.jar diuf.sudoku.test.serate \
--format="--format%l%%d: %d%l%%e: %e%l%%g: %g%l%%i: %i%l%%n: %n%l%%p: %p%l%%r: %r%l--- end of final section ---" \
--start="--start%l%%g: %g%l%%i: %i%l%%m: %m%l%%M:%l%M%l%%n: %n%l--- end of start section ---" \
--before="--before%l%%g: %g%l%%i: %i%l%%m: %m%l%%M:%l%M%l--- end of before section ---" \
--after="--after%l%%e: %e%l%%h:%l%h%l%%g: %g%l%%i: %i%l%%m: %m%l%%M:%l%M%l%%r: %r%l%%s: %s%l--- end of after section ---" \
--input=my_input_file.txt --output=- --threads=0 > my_output_file.txt

To display man document:

java -cp SukakuExplainer/SukakuExplainer.jar diuf.sudoku.test.serate --man

## Contributors:

Expand Down
37 changes: 30 additions & 7 deletions diuf/sudoku/test/serate.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@ static void help(int html) {
System.err.println("<PRE>");
}
System.err.println("NAME");
System.err.println(" serate - Sudoku Explainer command line rating");
System.err.println(" serate - Sukaku Explainer / Sudoku Explainer command line rating");
System.err.println("");
System.err.println("SYNOPSIS");
System.err.println(" serate [--diamond] [--after=FORMAT] [--before=FORMAT] [--format=FORMAT]");
System.err.println(" [--input=FILE] [--output=FILE] [--pearl] [--start=FORMAT] [--threads=N] [puzzle ...]");
System.err.println("");
System.err.println("DESCRIPTION");
System.err.println(" serate is a Sudoku Explainer command line entry point that rates one or more");
System.err.println(" input puzzles. If an --input=FILE option is specified then 81-character puzzle");
System.err.println(" serate is a Sukaku Explainer command line entry point that rates one or more");
System.err.println(" input puzzles. It is currently backward-compatible with serate v1.2.1");
System.err.println(" If an --input=FILE option is specified then 81-character puzzle");
System.err.println(" strings are read from that file, otherwise if 81-character puzzle operands are");
System.err.println(" not specified the puzzles are read from the standard input. If an --output=FILE");
System.err.println(" option is specified then the output is written to that file, otherwise output");
Expand All @@ -57,7 +58,7 @@ static void help(int html) {
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.");
System.err.println(" The default format is " + FORMAT + ". The format conversions are:");
System.err.println(" The default format is %r/%p/%d. The format conversions are:");
System.err.println(" %d The diamond rating. This is the highest ER of the methods leading");
System.err.println(" to the first candidate elimination. (F)");
System.err.println(" %e The elapsed time to rate the puzzle. (AF)");
Expand Down Expand Up @@ -95,15 +96,37 @@ static void help(int html) {
System.err.println(" Print the Sudoku Explainer (serate) version and exit.");
System.err.println("");
System.err.println("INVOCATION");
System.err.println("");
System.err.println(" java -Xrs -Xmx500m -cp SudokuExplainer.jar diuf.sudoku.test.serate ...");
System.err.println("");
/* System.err.println("EXAMPLES");
System.err.println("");
System.err.println(" Note: % must be entered as %% in windows .bat files and shortcut commands.");
System.err.println("");
System.err.println(" To rate a single or a group of puzzle(s):");
System.err.println(" java.exe -Xrs -Xmx500m -cp SukakuExplainer.jar diuf.sudoku.test.serate --format="%g ED=%r/%p/%d" --input=puzzles.txt --output=puzzles.rated.txt");
System.err.println("");
System.err.println(" To display all supported format parameters (at the time of writing this document):");
System.err.println(" java -Xrs -Xmx1g -cp SukakuExplainer.jar diuf.sudoku.test.serate \");
System.err.println(" --format="--format%l%%d: %d%l%%e: %e%l%%g: %g%l%%i: %i%l%%n: %n%l%%p: %p%l%%r: %r%l--- end of final section ---" \");
System.err.println(" --start="--start%l%%g: %g%l%%i: %i%l%%m: %m%l%%M:%l%M%l%%n: %n%l--- end of start section ---" \");
System.err.println(" --before="--before%l%%g: %g%l%%i: %i%l%%m: %m%l%%M:%l%M%l--- end of before section ---" \");
System.err.println(" --after="--after%l%%e: %e%l%%h:%l%h%l%%g: %g%l%%i: %i%l%%m: %m%l%%M:%l%M%l%%r: %r%l%%s: %s%l--- end of after section ---" \");
System.err.println(" --input=my_input_file.txt --output=- --threads=0 > my_output_file.txt");
System.err.println(" ");
System.err.println(" To display man document:");
System.err.println(" java -cp SukakuExplainer/SukakuExplainer.jar diuf.sudoku.test.serate --man");
System.err.println("");*/
System.err.println("SEE ALSO");
System.err.println(" SudokuExplainer(1), sudoku(1)");
System.err.println(" SudokuExplainer(1), sudoku(1),");
System.err.println(" https://github.com/SudokuMonster/SukakuExplainer/wiki/Batch-mode-command-line-parameters");
System.err.println(" https://github.com/SudokuMonster/SukakuExplainer");
System.err.println(" ");
System.err.println("");
System.err.println("IMPLEMENTATION");
System.err.println(" version serate " + VERSION + " (Sudoku Explainer) " + RELEASE);
System.err.println(" version serate 1.3.0.0 (Sudoku Explainer) 2019-08-24");
System.err.println(" author Nicolas Juillerat");
System.err.println(" copyright Copyright (c) 2006-2009 Nicolas Juillerat");
System.err.println(" copyright Copyright (c) 2006-2019 Nicolas Juillerat");
System.err.println(" license Lesser General Public License (LGPL)");
if (html != 0) {
System.err.println("</PRE>");
Expand Down
90 changes: 50 additions & 40 deletions sukakuexplainer.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,48 +6,53 @@
<BODY bgcolor=white>
<PRE>
NAME
serate - Sukaku and Sudoku Explainer command line rating
hints - Sukaku and Sudoku Explainer hints display
pencilmarks - Sukaku and Sudoku Pencilmark display
serate - Sukaku Explainer / Sudoku Explainer command line rating

SYNOPSIS
serate [ --diamond ] [ --format=FORMAT ] [ --input=FILE ] [ --output=FILE ] [ --pearl ] [ puzzle ... ]
hints [ --input=FILE ]
pencilmarks [ --input=FILE ]
serate [--diamond] [--after=FORMAT] [--before=FORMAT] [--format=FORMAT]
[--input=FILE] [--output=FILE] [--pearl] [--start=FORMAT] [--threads=N] [puzzle ...]

DESCRIPTION
serate is a Sudoku/Sukaku Explainer command line entry point that rates one or more
input puzzles. If an --input=FILE option is specified then 729-character per line
Sukaku puzzles are read from that file, otherwise if the file doesn't contain
729-character per line Sukaku puzzles then 81-character sudoku puzzle
serate is a Sukaku Explainer command line entry point that rates one or more
input puzzles. It is currently backward-compatible with serate v1.2.1
If an --input=FILE option is specified then 81-character puzzle
strings are read from that file, otherwise if 81-character puzzle operands are
not specified the puzzles are read from the standard input. If an --output=FILE
option is specified then the output is written to that file, otherwise output
is written to the standard output. The output is controlled by the
--format=FORMAT option.
--format=FORMAT option (F) as well as --start (S), --before (B), and --after (A) options.

Ratings are floating point numbers in the range 0.0 - 20.0, rounded to the
tenths digit. 0.0 indicates a processing error and 20.0 indicates a valid
tenths digit. 0.0 indicates a processing error and 20.0 indicates an valid
but otherwise unsolvable input puzzle.

For GUI, hints and pencilmarks please see INVOCATION then EXAMPLES

serate OPTIONS
OPTIONS
-a, --after=FORMAT
Format the output after each step according to FORMAT. Default is empty.
-b, --before=FORMAT
Format the output before each step according to FORMAT. Default is empty.
-d, --diamond
Terminate rating if the puzzle is not a diamond.
-f, --format=FORMAT
Format the output for each input puzzle according to FORMAT. Format
conversion are %CHARACTER; all other characters are output unchanged.
The default format is %r/%p/%d. The format conversions are:
%d The diamond rating. This is the highest ER of the methods leading
to the first candidate elimination.
%e The elapsed time to rate the puzzle.
%g The puzzle grid in 81-character [0-9] form.
%n The input puzzle ordinal, counting from 1.
to the first candidate elimination. (F)
%e The elapsed time to rate the puzzle. (AF)
%h The long step description in multi-line HTML format. (A)
%g The input puzzle line. (SBAF)
%i The puzzle grid in 81-character [0-9] form. (SBAF)
%l The new line. (SBAF)
%m The input puzzle pencilmarks in 729-char format. (SBA)
%M The input puzzle pencilmarks in multi-line format. (SBA)
%n The input puzzle ordinal, counting from 1. (SF)
%p The pearl rating. This is the highest ER of the methods leading
to the first cell placement.
to the first cell placement. (F)
%r The puzzle rating. This is the highest ER of the methods leading
to the puzzle solution.
to the puzzle solution. (AF)
%s The short step description. (A)
%t The tab character. (SBAF)
%% The % character.
-h, --html
List detailed info in html.
Expand All @@ -61,38 +66,43 @@
Write output to FILE instead of the standard output.
-p, --pearl
Terminate rating if the puzzle is not a pearl.
-s, --start=FORMAT
Format the output before each puzzle according to FORMAT. Default is empty.
-t, --threads
Maximal degree of parrallelism. Default 0=auto. 1=no parallelism; -1=unlimited
-V, --version
Print the Sudoku Explainer (serate) version and exit.

INVOCATION
GUI:
java.exe -jar SukakuExplainer.jar

Command Line:
java.exe -Xrs -Xmx500m -cp SukakuExplainer.jar diuf.sudoku.test.serate ...

Display Hints:
java.exe -Xrs -Xmx500m -cp SukakuExplainer.jar diuf.sudoku.test.hints ...

Display Pencilmarks:
java.exe -Xrs -Xmx500m -cp SukakuExplainer.jar diuf.sudoku.test.pencilmarks ...

java -Xrs -Xmx500m -cp SudokuExplainer.jar diuf.sudoku.test.serate ...

EXAMPLES

Note: % must be entered as %% in windows .bat files and shortcut commands.

To rate a single or a group of puzzle(s):
java.exe -Xrs -Xmx500m -cp SukakuExplainer.jar diuf.sudoku.test.serate --format="%g ED=%r/%p/%d" --input=puzzles.txt --output=puzzles.rated.txt

To display all supported format parameters (at the time of writing this document):
java -Xrs -Xmx1g -cp SukakuExplainer.jar diuf.sudoku.test.serate \
--format="--format%l%%d: %d%l%%e: %e%l%%g: %g%l%%i: %i%l%%n: %n%l%%p: %p%l%%r: %r%l--- end of final section ---" \
--start="--start%l%%g: %g%l%%i: %i%l%%m: %m%l%%M:%l%M%l%%n: %n%l--- end of start section ---" \
--before="--before%l%%g: %g%l%%i: %i%l%%m: %m%l%%M:%l%M%l--- end of before section ---" \
--after="--after%l%%e: %e%l%%h:%l%h%l%%g: %g%l%%i: %i%l%%m: %m%l%%M:%l%M%l%%r: %r%l%%s: %s%l--- end of after section ---" \
--input=my_input_file.txt --output=- --threads=0 > my_output_file.txt

To display explainer hints (output is to standard output):
java.exe -Xrs -Xmx500m -cp SukakuExplainer.jar diuf.sudoku.test.hints --input=puzzle.txt

To display explainer pencilmarks (output is to standard output):
java.exe -Xrs -Xmx500m -cp SukakuExplainer.jar diuf.sudoku.test.pencilmarks --input=puzzle.txt
To display man document:
java -cp SukakuExplainer/SukakuExplainer.jar diuf.sudoku.test.serate --man

SEE ALSO
SudokuExplainer(1), sudoku(1),
https://github.com/SudokuMonster/SukakuExplainer/wiki/Batch-mode-command-line-parameters
https://github.com/SudokuMonster/SukakuExplainer

CONTRIBUTORS


IMPLEMENTATION
version SukakuExplainer 1.2.1.4 (Sudoku Explainer) 2019-08-09
version serate 1.3.0.0 (Sudoku Explainer) 2019-08-24
author Nicolas Juillerat
copyright Copyright (c) 2006-2019 Nicolas Juillerat
license Lesser General Public License (LGPL)
Expand Down

0 comments on commit 152fba0

Please sign in to comment.