colortest.pl: made it run under strict and warnings

This commit is contained in:
Adrian Kreher 2008-12-19 17:09:08 -06:00
parent db26b02adb
commit 969e55737e

View file

@ -27,7 +27,8 @@ print "* available combination\n";
print "*\n";
print "**************************\n";
if( $ARGV[0] eq "-w" || $ARGV[1] eq "-w" || $ARGV[2] eq "-w" ) {
my @arr;
if( grep {$_ eq '-w'} @ARGV ) {
push(@arr, [( " 16: 00/00/00", " 17: 00/00/5f", " 18: 00/00/87", " 19: 00/00/af", " 20: 00/00/d7", " 21: 00/00/ff" )] );
push(@arr, [( " 22: 00/5f/00", " 23: 00/5f/5f", " 24: 00/5f/87", " 25: 00/5f/af", " 26: 00/5f/d7", " 27: 00/5f/ff" )] );
push(@arr, [( " 28: 00/87/00", " 29: 00/87/5f", " 30: 00/87/87", " 31: 00/87/af", " 32: 00/87/d7", " 33: 00/87/ff" )] );
@ -69,45 +70,44 @@ if( $ARGV[0] eq "-w" || $ARGV[1] eq "-w" || $ARGV[2] eq "-w" ) {
push(@arr, [( " 244: 80/80/80", " 245: 8a/8a/8a", " 246: 94/94/94", " 247: 9e/9e/9e", " 248: a8/a8/a8", " 249: b2/b2/b2")] );
push(@arr, [( " 250: bc/bc/bc", " 251: c6/c6/c6", " 252: d0/d0/d0", " 253: da/da/da", " 254: e4/e4/e4", " 255: ee/ee/ee")] );
if( $ARGV[0] eq "-s" || $ARGV[1] eq "-s" || $ARGV[2] eq "-s" ){
$padding = " ";
}
my $padding = '';
$padding = ' ' if grep {$_ eq '-r'} @ARGV;
# display in reverse order
if( $ARGV[0] eq "-r" || $ARGV[1] eq "-r" || $ARGV[2] eq "-r" ){
for( $dimone = 0; $dimone < scalar @arr; $dimone++ ) {
if( grep {$_ eq '-r'} @ARGV ) {
for( my $dimone = 0; $dimone < scalar @arr; $dimone++ ) {
$seed = ($dimone % 6) * -1;
for( $dimtwo = 0; $dimtwo < 6; $dimtwo++ ) {
my $seed = ($dimone % 6) * -1;
for( my $dimtwo = 0; $dimtwo < 6; $dimtwo++ ) {
$movone = $seed;
$movtwo = $seed * -1;
my $movone = $seed;
my $movtwo = $seed * -1;
print $arr[$dimone][$dimtwo] . $padding;
$seed = $seed+1;
$seed++;
}
print "\n";
}
}
else {
for( $dimone = 0; $dimone < scalar @arr; $dimone++ ) {
for( my $dimone = 0; $dimone < scalar @arr; $dimone++ ) {
$seed = ($dimone % 6) * -1;
for( $dimtwo = 0; $dimtwo < 6; $dimtwo++ ) {
my $seed = ($dimone % 6) * -1;
for( my $dimtwo = 0; $dimtwo < 6; $dimtwo++ ) {
$movone = $seed;
$movtwo = $seed * -1;
my $movone = $seed;
my $movtwo = $seed * -1;
$newone = $dimone+$movone;
$newtwo = $dimtwo+$movtwo;
my $newone = $dimone+$movone;
my $newtwo = $dimtwo+$movtwo;
if( $newone < scalar @arr ){
print $arr[$newone][$newtwo] . $padding;
}
$seed = $seed+1;
$seed++;
}
print "\n";
@ -361,5 +361,5 @@ else {
print "\n";
print "\n";
}
print "";
print ""; # reset the colors to the default
exit;