in reply to Re^4: Need help with Peal!
in thread Need help with Peal!
I'd suggest breaking the string apart into individual letters (see split) and then using a hash table to track the letters. You can also use a hash table to track the words used, as well. See perlfaq4, sections "How can I remove duplicate elements from a list or array?" through "How can I test whether two arrays or hashes are equal?" for the basic method and examples.
I don't recall whose signature line it is, but it's particularly appropriate: Figure out how to do the task by hand, and *then* write the program to do that. If you don't understand a technique but try to apply it, then my signature line becomes more appropriate. ;^P
...roboticus
When your only tool is a hammer, all problems look like your thumb.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Need help with Peal!
by Anonymous Monk on Nov 25, 2012 at 22:54 UTC | |
by roboticus (Chancellor) on Nov 26, 2012 at 01:16 UTC | |
by ivanzhibin (Initiate) on Nov 26, 2012 at 22:53 UTC | |
by bulk88 (Priest) on Nov 27, 2012 at 05:22 UTC | |
by ivanzhibin (Initiate) on Nov 26, 2012 at 01:52 UTC | |
by roboticus (Chancellor) on Nov 26, 2012 at 02:50 UTC | |
by bulk88 (Priest) on Nov 27, 2012 at 05:14 UTC |