checkers pattern by jonathan camacho

my ($y, $x) = (split(/ /, <>));
my $c = 1;
my $rs = 1;
for(1 .. $y){
   $c = $rs;
   $out = "";
   for(1 .. $x){
     $out .= $c . " ";
     $c ^= 1;
   }
   $out =~ s/ $/\n/;
   print $out;
   $rs ^= 1;
}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page