Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
would return the matching positions of similar characters[b][o][o][k] [r][e][b][o][o][t] [r][o][c][k][e][t]
If anyone could suggest a better way to this, I'd be greatful.#compare the (s)source patterns for ( my $i=0 ; $i<$row ; $i++ ) { #for each column in a row print "number of cols= $#{s1[$i]}\n"; if ($j=0;$j<$#{s1[$i]};$j++) { if (s1[i][j]==s1[i+1][j+1]){print "$i,$j\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: ideas needed for finding matching characters in 2d array
by ikegami (Patriarch) on Aug 27, 2008 at 05:11 UTC | |
|
Re: ideas needed for finding matching characters in 2d array
by GrandFather (Saint) on Aug 27, 2008 at 05:20 UTC | |
|
Just in case...
by juster (Friar) on Aug 27, 2008 at 05:50 UTC | |
|
Re: ideas needed for finding matching characters in 2d array
by Anonymous Monk on Aug 27, 2008 at 05:08 UTC |