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

samtregar,
I was discussing this earlier in the CB. This is the first year perl has been included in the competition so perhaps the problems are a bit more challenging in the other scripting languages.

The only problem I have entered so far is the first event in the advanced category. I asked for clarification on the following words:

The response I got was along the lines of - wouldn't would be considered 8 characters, we thought we had eliminated all words with spaces so not sure how war game was missed and woolen& looks like an error with the list.

This told me they were not placed there intentionally to make the task more difficult. I needed to find some way of making it a bit more challenging so my solution is only 4 lines of code (not golfed) and is probably one of the fastest solutions submitted. Unfortunately, I suspect I will be disqualified. I am not entering any more events until I find out for sure.

Cheers - L~R

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

    Wow. Four lines is pretty lean. Is that four statements? Just prompting for a number and reading it back is two, plus printing the result is three and that doesn't count opening the word list file. Or do you mean that the algorithm parts rather than the housekeeping parts are four lines?

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

        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.

      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.

Re^3: 2008 Winter Scripting Games have begun
by samtregar (Abbot) on Feb 18, 2008 at 05:18 UTC
    Why are you going to be disqualified?

    -sam

      samtregar,
      They made it pretty clear that you needed to make sure your code looked for wordlist.txt in 'C:\Scripts' or it wouldn't work. My solution doesn't use wordlist.txt at all so I thought they might disqualify me. They didn't, so I will probably enter a few more creative solutions to see how that goes.

      Cheers - L~R