in reply to A Semi-automatic word search solver
Here is a small subroutine (really only one line long) to make the building of your @puzzle array even easier.
One question if I may: Why are you using subroutine prototypes in your search subroutine?use strict; use warnings; use Data::Dumper; my @puzzle = qw/abcde fghij klmno pqrst uvwxy/; @puzzle = make_puzzle(@puzzle); print Dumper(\@puzzle); sub make_puzzle{ return map{[split //, $_]} @_; }
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: A Semi-automatic word search solver
by The Hindmost (Scribe) on Sep 26, 2009 at 15:49 UTC | |
by CountZero (Bishop) on Sep 26, 2009 at 19:34 UTC | |
by The Hindmost (Scribe) on Sep 26, 2009 at 21:54 UTC |
In Section
Cool Uses for Perl