in reply to Chess Board Single Loop

To continue the silliness, here's one that hides the loop in a regex:

#!/usr/bin/env perl use strict; use warnings; $_ = '1' x 64; s{1}{ my $p=pos()+1; sprintf("%3d",$p).($p%8?'':"\n") }ge; print;

Aaron B.
Available for small or large Perl jobs; see my home node.

Replies are listed 'Best First'.
Re^2: Chess Board Single Loop
by hdb (Monsignor) on Oct 04, 2013 at 07:02 UTC

    How about this?

    print join( " ", 1..64 ) =~ s/(\d+\s?){8}\K/\n/gr;