in reply to Re^3: 2008 Winter Scripting Games have begun
in thread 2008 Winter Scripting Games have begun

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.

Cheers - L~R

Replies are listed 'Best First'.
Re^5: 2008 Winter Scripting Games have begun
by xdg (Monsignor) on Feb 18, 2008 at 23:37 UTC

    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.

      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.

      Cheers - L~R

        If it's the same wordlist, that certainly sounds sufficient to meet the requirement. Though I would say that approach could be considered more than "four lines" long. ;-)

        -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.