in reply to perl/cgi Boggle

Not really golfing here, but there's far too much code in that last subroutine.
sub build_board_array { my @board = split //, shift; s/Q/Qu/ foreach @board; @board = map { +{ line => [map +{ letter => $_ }, splice @board, 0, 4 ]}; } 1..4; return \@board; }

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.


UPDATE: oops, forgot one arrayref constructor.

Replies are listed 'Best First'.
Re: Re: perl/cgi Boggle
by ajdelore (Pilgrim) on Aug 15, 2003 at 23:28 UTC

    Much thanks... I knew there must have been a better way to do that. I should have asked the monks. :)

    </ajdelore>