RosettaCodeData/Task/Munching-squares/Perl/munching-squares.pl
2023-07-01 13:44:08 -04:00

12 lines
278 B
Perl

use GD;
my $img = GD::Image->new(256, 256, 1);
for my $y (0..255) {
for my $x (0..255) {
my $color = $img->colorAllocate( abs(255 - $x - $y), (255-$x) ^ $y , $x ^ (255-$y));
$img->setPixel($x, $y, $color);
}
}
print $img->png