xdg,
Who said anything about opening the word list file?
1. Obtain all possible solutions through nefarious means
2. Print a line asking for input
3. Get a phone number as input
4. Display the result
Since I wasn't disqualified, I will wait until after the deadline for event 1 before revealing my solution.
| [reply] [d/l] |
Well, the event description does have the following clause:
In addition, the word must appear in the file WordList.txt
That does sort of imply that even if you use nefarious means, you should be checking that a word from the 'nefarious' list is also in their WordList.
Of course, maybe they won't catch that. ;-)
-xdg
Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
| [reply] |
xdg,
Well, I calculated how many words were exactly 7 characters long and did not contain Q or Z. After removing duplicates (words that generated the same phone number), there were only 3818 entries. I precomputed all possible solutions and stuck them in __DATA__ so nefarious means =
my %lookup = unpack("(A7A7)*", <DATA>);
Provided they use the same wordlist.txt that was distributed in the kit, my solution is valid. Since I have been awarded 10 points, I assume they didn't really mean you have to point to 'C:\Scripts' when they run it.
| [reply] [d/l] |
But it's a good challenge to think through. Though I ran it against my unix dictionary list, I was able to get it to 5 lines -- not counting strict and warnings. I could see how with a little "do" or "and" trickery or golfing, I could make it 4 or less, but it's not really the point, I guess. (E.g. "say 'Enter number' and my $num = <STDIN>") And as you said, it's very fast.
Maybe I should enter after all.
-xdg
Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
| [reply] |