Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
is there a way to traverse this AoA by column? I want to calculate the number of occurences for each letter (X, W and Z) in the respective column, and, if there are more than 60% of one letter in a column, the the final combined array will hold this letter. If we have a tie, or les than 60%, we would use another letter, say A@AoA = ( [ "X", "Z", "W", "X", "Z", "Z" ], [ "Z", "Z", "X", "X", "X", "W" ], [ "X", "Z", "X", "W", "W", "W" ], [ "Z", "X", "W", "X", "Z", "Z" ], [ "Z", "X", "W", "X", "X", "W" ], [ "Z", "X", "X", "X", "Z", "W" ], );
[ "Z", "A", "A", "X", "Z", "W" ]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Find all values of an AoA by columns
by ikegami (Patriarch) on Jun 11, 2009 at 19:33 UTC | |
|
Re: Find all values of an AoA by columns
by GrandFather (Saint) on Jun 11, 2009 at 20:46 UTC | |
|
Re: Find all values of an AoA by columns
by Transient (Hermit) on Jun 11, 2009 at 19:47 UTC | |
|
Re: Find all values of an AoA by columns
by NetWallah (Canon) on Jun 11, 2009 at 21:22 UTC | |
|
Re: Find all values of an AoA by columns
by repellent (Priest) on Jun 11, 2009 at 21:36 UTC | |
|
Re: Find all values of an AoA by columns
by lostjimmy (Chaplain) on Jun 11, 2009 at 20:42 UTC | |
|
Re: Find all values of an AoA by columns
by bichonfrise74 (Vicar) on Jun 11, 2009 at 22:04 UTC |