File tree 4 files changed +21
-8
lines changed
4 files changed +21
-8
lines changed Original file line number Diff line number Diff line change 2
2
3
3
set -e
4
4
5
+ perl solve_from_db.pl expert 95; perl vis.pl < foo > solver.svg
6
+
5
7
MAP_HEIGHT=10 MAP_WIDTH=10 PIECES=20 cmake . && make
6
8
bin/mklinjat --puzzle_count=1 --seed=90210 --solve_progress_file=progress-opt.json --score_cover=1 --score_cant_fit=3 --score_square=50 --score_dep=100 --score_one_of=60 --score_max_width=-1
7
9
perl vis.pl < progress-opt.json > progress-opt.svg
8
10
9
- MAP_HEIGHT=8 MAP_WIDTH=8 PIECES=15 cmake . && make
11
+ MAP_HEIGHT=10 MAP_WIDTH=10 PIECES=16 cmake . && make
10
12
bin/mklinjat --puzzle_count=1 --seed=90210 --candidate_progress_file=dots-opt.json --score_cover=1 --score_cant_fit=3 --score_square=50 --score_dep=100 --score_one_of=60 --score_max_width=-1 --optimize_iterations=0
11
13
perl vis.pl < dots-opt.json > dots-opt.svg
12
14
15
+ perl solve_from_db.pl easy 4; perl vis.pl < foo > unique.svg
16
+
17
+ for i in solver progress-opt dots-opt unique; do
18
+ rsvg-convert < $i .svg > $i .png
19
+ convert $i .png -scale 480 $i -thumb.png
20
+ done
Original file line number Diff line number Diff line change 18
18
19
19
die if system " MAP_HEIGHT=$h MAP_WIDTH=$w PIECES=$p cmake . && make " ;
20
20
my $res = qx( bin/mklinjat --solve="$str " --solve_progress_file=foo) ;
21
-
21
+ print $res ;
22
+ my $json = decode_json $res ;
23
+ print $json -> {classification }{' single-solution' }{depth };
22
24
23
25
Original file line number Diff line number Diff line change @@ -1118,14 +1118,15 @@ Game add_forced_squares(Game game, FILE* fp) {
1118
1118
if (game.force_if_uncontested () && fp)
1119
1119
game.print_json (fp, " \" type\" :\" ambiguate\" ," );
1120
1120
auto res = game.iterate();
1121
- if (fp)
1122
- game.print_json (fp, " " );
1123
1121
if (res.first == DeductionKind::NONE) {
1124
1122
if (!game.force_one_square ()) {
1125
1123
break ;
1126
1124
}
1127
1125
if (fp)
1128
1126
game.print_json (fp, " \" type\" :\" add dot\" ," );
1127
+ } else {
1128
+ if (fp)
1129
+ game.print_json (fp, " " );
1129
1130
}
1130
1131
if (game.impossible ()) {
1131
1132
break ;
Original file line number Diff line number Diff line change @@ -21,13 +21,13 @@ sub draw_board {
21
21
my $hwidth = $width / 2;
22
22
23
23
if ($board -> {type }) {
24
- print " <text x='$hwidth ' y='18' text-anchor='middle' fill='black' class='number '>$board ->{type}</text>" ;
24
+ print " <text x='$hwidth ' y='18' text-anchor='middle' fill='black' class='text '>$board ->{type}</text>" ;
25
25
}
26
26
if (exists $board -> {iter }) {
27
- print " <text x='5' y='18' text-anchor='left' fill='black' class='snumber '>Iteration: $board ->{iter}</text>" ;
27
+ print " <text x='5' y='18' text-anchor='left' fill='black' class='text '>Iteration: $board ->{iter}</text>" ;
28
28
}
29
29
if (exists $board -> {score }) {
30
- print " <text x='$hwidth ' y='18' text-anchor='middle' fill='black' class='snumber '>Score: $board ->{score}</text>" ;
30
+ print " <text x='$hwidth ' y='18' text-anchor='middle' fill='black' class='text '>Score: $board ->{score}</text>" ;
31
31
}
32
32
print " <g transform='translate(5, 21)'>" ;
33
33
print " <rect x='0' y='0' height='$height ' width='$width ' stroke='black' stroke-width='2' fill='white'/>" ;
@@ -75,8 +75,10 @@ sub draw_board {
75
75
76
76
print qq( <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
77
77
<style>
78
- .number { font: bold 28px sans-serif; }
78
+ .number { font-size: 28px; }
79
+ .text { font-size: 16px; }
79
80
</style>
81
+ <rect width="100%" height="100%" fill="white"></rect>
80
82
) ;
81
83
82
84
my $x_offset = 5;
You can’t perform that action at this time.
0 commit comments