|
49 | 49 | }
|
50 | 50 | #+END_SRC
|
51 | 51 |
|
| 52 | + |
52 | 53 | * Generate
|
53 | 54 |
|
54 |
| -** Configure the solver |
| 55 | +** Create the solver |
55 | 56 |
|
56 |
| -#+BEGIN_SRC sh |
57 |
| - rm solver.sh |
58 |
| - ln -s solver-generate.sh solver.sh |
| 57 | +#+BEGIN_SRC sh :tangle solver.sh |
| 58 | +JAR=cryptator-0.5.1-SNAPSHOT-with-dependencies.jar |
| 59 | +MAINCLASS=cryptator.Cryptagen |
| 60 | + |
| 61 | +MAINARGS=`cat $1 $2 | xargs` |
| 62 | + |
| 63 | +INSTNAME=`echo $INSTNAME | sed 's/\s-*/-/g'` |
| 64 | +echo i `basename -s .dat $2` |
| 65 | +## SEED=`shuf -i1-1000 -n1` |
| 66 | +java -server -Xms512m -Xmx8192m -cp $JAR $MAINCLASS $MAINARGS |
| 67 | +exit $? |
59 | 68 | #+END_SRC
|
60 | 69 |
|
61 | 70 | ** Configure instances
|
|
85 | 94 |
|
86 | 95 |
|
87 | 96 | * Generate and Solve
|
88 |
| -** Configure the solver |
| 97 | +** Create the solver |
89 | 98 |
|
90 |
| -#+BEGIN_SRC sh |
91 |
| - rm solver.sh |
92 |
| - ln -s solver-generate-and-solve.sh solver.sh |
| 99 | +#+BEGIN_SRC sh :tangle solver.sh |
| 100 | +JAR=cryptator-0.5.1-SNAPSHOT-with-dependencies.jar |
| 101 | +MAINCLASS=cryptator.Cryptagen |
| 102 | + |
| 103 | +MAINARGS=`cat $1 $2 | xargs` |
| 104 | + |
| 105 | +java -server -Xms512m -Xmx8192m -cp $JAR $MAINCLASS $MAINARGS | head -n -10 |
| 106 | +exit $? |
93 | 107 | #+END_SRC
|
94 | 108 |
|
95 | 109 | ** Configure instances
|
@@ -143,11 +157,23 @@ The word lists ~colors.txt~ and ~monsters.txt~ takes the most time by far (aroun
|
143 | 157 |
|
144 | 158 |
|
145 | 159 | * Solve
|
146 |
| -** Configure the solver |
| 160 | +** Create the solver |
147 | 161 |
|
148 |
| -#+BEGIN_SRC sh |
149 |
| - rm solver.sh |
150 |
| - ln -s solver-solve.sh solver.sh |
| 162 | +#+BEGIN_SRC sh :tangle solver.sh |
| 163 | + JAR=cryptator-0.5.1-SNAPSHOT-with-dependencies.jar |
| 164 | + MAINCLASS=cryptator.Cryptator |
| 165 | + |
| 166 | + MAINARGS=`cat $1 | xargs` |
| 167 | + |
| 168 | + ## exclude cryptarithm with long words |
| 169 | + ## grep -wvE '\w{10,}' $2 | sed 's/[[:space:]]//g' | xargs java -server -Xms512m -Xmx8192m -cp $JAR $MAINCLASS $MAINARGS |
| 170 | + |
| 171 | + ## exclude cryptarithm without long words |
| 172 | + ## grep -wE '\w{10,}' $2 | sed 's/[[:space:]]//g' | xargs java -server -Xms512m -Xmx8192m -cp $JAR $MAINCLASS $MAINARGS |
| 173 | + |
| 174 | + ## Do not exclude anything |
| 175 | + sed 's/[[:space:]]//g' $2 | xargs java -server -Xms512m -Xmx8192m -cp $JAR $MAINCLASS $MAINARGS |
| 176 | + exit $? |
151 | 177 | #+END_SRC
|
152 | 178 |
|
153 | 179 | ** Configure instances
|
|
0 commit comments