Ano chyb tam je vic (asi sest radek se rozpadlo). Moje reseni:
1. Ze dvou souboru udelam jeden se spravnymi barevnymi hodnotami
perl -e 'open D1, "<$ARGV[0]" || die; open D2, "<$ARGV[1]" || die; $k=
2. Vytvorim 'HTML obrazek' pomoci nasledujiciho kodu. S nejakou optimalizaci jsem se neobtezoval ;-)
#!/usr/bin/perl
my @radek = ();
my $cell = 1;
open (IN1, '<root4.hex') || die "failed to open root4.hex";
print < @_) {
push @_, @p[scalar(@_)..527-1];
if ($l==121) {
$_[448] = $_[447]; $_[450] = $_[449]; $_[452] = $_[453];
} elsif ($l==124) {
$_[454] = $_[453];
}
}
print "\t<tr>\n";
for my $i (0..527) {
print "\t\t<td bgcolor='#$_[$i]'></td>\n";
}
print "\t</tr>\n";
}
sub adj {
if (@_ < 527) {
my $p = 210;
$p = 2 if($l > 100);
my $i = $_[$p];
my @a = ();
push @a, $i for (scalar(@_)..526);
splice @_, $p, 0, @a;
} elsif(@_ > 527) {
my $i = $_[0];
my $b = 0;
my $c = 0;
my $d = 0;
my @a1;
for $c (0..$#_) {
if ($_[$c] eq $i && $_[$c+1] eq $i && $_[$c+2] eq $i && $_[$c+3] eq $i && $_[$c+4] eq $i) {
if($b) {
$d = $c;
last;
}
} else {
$b = 1;
}
}
prn(splice @_, 0, $d);
$l++;
adj(@_);
return;
}
@p = @_;
prn(@_);
}
while (<IN1>) {
chomp;
next if(!length $_);
for my $item (split /\s+/) {
next if(!length $_);
if ($item eq 'X') {
$l ++;
adj(@radek);
@radek = ();
} else {
next if(!length $item);
push @radek, $item;
}
}
}
print <<"EOFOOT";
>
</table>
</body>
</html>
EOFOOT
close IN1;