Thread: Almost Daily Contest #4

  1. #16
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >On the other hand, Prelude may claim that it is "uncompilable"...
    Most of the time I'll try my best to get the code to compile. If it takes too many changes that effects the score.

    >is it only the characters found in the function?
    The function is all I'll count. Hopefully everyone will do as Salem and just submit a function with the defined interface so that I can plug it into my test program.

    >is the table going to contain what was defined above, or is it a user inputed
    You don't know. All you know is that you get an array of strings for the table. However, you may assume that the table is N^2. Of course, I didn't specify variable N (an oversight I assure you, but I've already gotten entries assuming an N of 5), so you can assume a similar sized table as the example.
    My best code is written with the delete key.

  2. #17
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227
    Wait - in C or C++? By what Salem said, I'm am I to assume it's in C?

    No matter anyway, really...the only real difference that you would probably see in this contest would be cout.

  3. #18
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >Wait - in C or C++?
    It doesn't matter.
    My best code is written with the delete key.

  4. #19
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227
    Originally posted by Prelude
    >Wait - in C or C++?
    It doesn't matter.
    Thought as much .

    I hate these contests. I always have so many ideas flying around my head that I can barely ever grab one and run with it long enough to finish.

  5. #20
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    Originally posted by Prelude
    However, you may assume that the table is N^2.
    You can? Yay, that simplifies some things.
    Well, by that I mean makes the code shorter ^^.
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  6. #21
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    Oh, yes. Another thing. You said you would only count the size of the function. But eventual #include's and #define's have to be counted too, right?
    There would be too much 'cheating' otherwise .
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  7. #22
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    Bah, another thing. Will the 'newline' character count as 0, 1 or 2 characters?
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  8. #23
    Wen Resu
    Join Date
    May 2003
    Posts
    219
    Can we use STL <if using c++>
    thinking of a nifty solution but if we can :P
    BTW i never thanked you for hosting these contest, great fun hehe

  9. #24
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227
    Originally posted by Iamien
    Can we use STL <if using c++>
    thinking of a nifty solution but if we can :P
    BTW i never thanked you for hosting these contest, great fun hehe
    I doubt it.

  10. #25
    Wen Resu
    Join Date
    May 2003
    Posts
    219
    aah worth a shot, back to drawing board

  11. #26
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145

    Re: Almost Daily Contest #4

    Originally posted by Prelude
    Code:
    
    
    Code:
    char *tab[] = { ... };
    wordSearch(tab, "cat", indices);
    The argument gives a compilation error for me. I changed the definition of tab from char to const char. Is that acceptable?
    It also works if you cast tab to a (const char**) in the argument list.


    EDIT: Lol, this is something new. You cannot post text including brackets without using code-tags. Great invention .
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  12. #27
    Wen Resu
    Join Date
    May 2003
    Posts
    219
    I had same problem, Dev C++
    i assume its good due to fact its becoming const anyway when you put it into the function

  13. #28
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227
    Change your files from a .cpp extensiopn to a .c extension. Problem solved.

  14. #29
    Wen Resu
    Join Date
    May 2003
    Posts
    219
    well that would life too simple now wouldn't it! :P
    Is this problem < the contest> realy as hard as it seems to me or am i missing something :P
    I can see kinda how to do it but it'll long so i'm gona loose hardcore hah

  15. #30
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >But eventual #include's and #define's have to be counted too, right?
    Only #include's and #define's essential for compilation.

    >Can we use STL <if using c++>
    Yes.

    >Is that acceptable?
    Yes.
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Almost Daily Contest Details
    By dagdarian in forum Contests Board
    Replies: 4
    Last Post: 01-25-2005, 05:03 AM
  2. Almost Daily Contest Details
    By Prelude in forum Contests Board
    Replies: 29
    Last Post: 09-19-2004, 10:32 PM
  3. Almost Daily Contest #3
    By Prelude in forum Contests Board
    Replies: 29
    Last Post: 08-16-2003, 08:48 PM
  4. Almost Daily Contest #2
    By Prelude in forum Contests Board
    Replies: 37
    Last Post: 08-09-2003, 10:51 PM
  5. Almost Daily Contest #1
    By Prelude in forum Contests Board
    Replies: 32
    Last Post: 08-05-2003, 08:34 AM