Branch Coverage

blib/lib/Games/Sudoku/PatternSolver.pm
Criterion Covered Total %
branch 93 138 67.3


line true false branch
33 80 23 ref $_[0] ? :
0 103 unless my $str_puzzle = ref $_[0] ? flatten_input(@_) : join("", @_)
36 0 103 unless length $str_puzzle == 81
39 0 103 if $VERBOSE
43 1 102 unless my $puzzle = new_puzzle("startTime", $start_time, "strPuzzle", $str_puzzle)
48 102 0 if ($USE_LOGIC)
50 0 102 unless Games::Sudoku::PatternSolver::CPLogic::apply_logic($puzzle)
56 99 3 if ($puzzle->{'logicFilled'})
57 0 99 if $VERBOSE
60 0 99 if $VERBOSE
63 22 80 if ($puzzle->{'logicSolved'})
64 0 22 if $VERBOSE
76 0 80 unless solve_puzzle($puzzle, $patterns_by_field, $all_patterns)
95 0 80 unless my $ref = ref $input
97 80 0 if ($ref eq "ARRAY")
98 80 0 if ($input->$#* == 80 and defined $input->[0] and not ref $input->[0])
102 0 0 if ($input->$#* == 8 and defined $input->[0] and ref $input->[0] eq "ARRAY" and $input->$#*->[0] == 8)
119 1513 0 defined $symbol_counts->{$b} ? :
1513 0 defined $symbol_counts->{$a} ? :
0 682 unless (defined $symbol_counts->{$b} ? $symbol_counts->{$b} : 0) <=> (defined $symbol_counts->{$a} ? $symbol_counts->{$a} : 0)
122 80 0 if ($USE_LOGIC)
124 5 687 unless (exists $symbol_counts->{$symbol})
127 2659 230621 $_->subset($no_clue_candidates) ? :
134 4 76 if ($LOOSE_MODE and @by_count < 8)
152 0 719 unless my $symbol_vector = $symbol_vectors->{$symbol}
159 334 385 if ($symbol_counts->{$symbol} == 9) { }
373 12 elsif ($symbol_counts->{$symbol} > 0) { }
166 373 0 if ($USE_LOGIC) { }
170 3160 1930472 $_->subset($allowed_positions) ? :
186 3744 0 if ($symbol_vector->subset($pattern_vector))
195 19702 18905 if ($test_vector->is_empty)
204 229 19702 unless ($inner)
210 3515 229 if ($outer) { }
220 0 719 unless ($found - $omitted)
227 0 719 if $VERBOSE
230 0 80 if $invalid
233 0 80 if $VERBOSE
236 0 80 if $VERBOSE
270 8701 13085 if ($test_vector->is_empty)
278 64 8701 unless ($inner)
284 2645 64 if ($outer) { }
293 0 639 if $VERBOSE
303 0 22930 if $depth > $puzzle->{'maxDepth'}
311 24717 815101 if ($test_vector->is_empty)
316 1867 22850 if ($depth == $puzzle->{'maxDepth'}) { }
320 1842 25 if ($newSolutionKey)
323 0 1842 if $VERBOSE
324 66 1776 unless check_for_max_solutions($puzzle->{'solutionCount'})
329 528 22322 unless find_solutions($depth + 1, $symbols, $possibles, $coverage_vector, $current_pattern_vectors, $puzzle)
348 633 15945 unless defined $symbol
349 0 15945 unless my $symbol_vector = $pattern_vectors->{$symbol}
359 0 0 if $VERBOSE and $solution_nr and $startTime
375 0 0 ++$row_count % 3 ? :
382 135 1707 if ($MAX_SOLUTIONS)
383 66 69 if ($solution_count >= $MAX_SOLUTIONS)
384 0 66 if $VERBOSE
398 78 2 if $Games::Sudoku::PatternSolver::exitHandler
399 0 2 if $old_handler
404 0 0 if $sub_to_execute
410 0 80 if ($old_handler)
456 0 103 unless my $puzzle_string = $puzzle->{'strPuzzle'}
465 3517 4826 if ($symbol =~ /[1-9]/)
479 0 103 if $VERBOSE
481 0 103 if ($puzzle->{'uniqueGivens'} < 5) { }
1 200 elsif ($puzzle->{'uniqueGivens'} < 8 and not $LOOSE_MODE) { }
490 0 102 if ($puzzle->{'givensCount'} < 17)
501 80 0 unless defined $thorough
503 80 0 if ($thorough) { }
536 25 1842 if (exists $puzzle->{'knownSolutions'}{$key})