#!/usr/bin/perl -w
use strict;

my @args;
while ($_ = shift) {
      push @args, $_;
}
my $arg_str = join (" ", @args);

my $output = `solve_sudoku -no_show $arg_str`;

foreach my $line (split "\n", $output) {
    if ($line =~ /total squash| record:| level:|Raw rating|Level|Stars/) {
	$line =~ s/^\s*/  /;
	$line =~ s/Solved cells at each level:/Cells by level:/;
	if ($line =~ /^(.*?:)\s+([0-9].*)/) {
	    my $title = $1;
	    my $val = $2;
	    $line = sprintf "%-22s %s", $title, $val;
	}
	print "$line\n";
    }
}


