Thread: ADC #2 Results

  1. #1
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897

    ADC #2 Results

    Sorry about the crappy reviews. The code was a smidge too long and being rushed and sleepy makes for weird looking code. Anyway, I'm pretty sure the scores are correct enough to determine winners:

    Beginner
    --------

    KurtSerge - 39
    XSquared - 40
    vasanth - 35
    ygfperson - 34

    Winner: XSquared!


    Intermediate
    ------------

    XSquared - 5
    vasanth - 20
    Sean345 - 35
    ygfperson - 32
    ClownPimp - 39

    Winner: ClownPimp!


    Advanced
    --------

    XSquared - 5
    vasanth - 20
    ClownPimp - 36

    Winner: ClownPimp!

    The reviews will not include source code, and most of them won't have an extensive code review. Any contestants who want their code viewed should post it in reply to these results.

    Concerning the next ADC, we'll take a break for me to catch my breath and resume shortly. Probably sometime in the next few days. Thanks for participating so far!
    Last edited by Prelude; 08-10-2003 at 11:44 AM.
    My best code is written with the delete key.

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    KurtSerge
    ---------

    Beginner
    --------

    Summary: Good algorithm, noce and quick. Well done.

    Code Review: None for this task

    Correctness: 10
    Speed: 9
    Elegance: 10
    Portability: 10
    My best code is written with the delete key.

  3. #3
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    XSquared
    --------

    Beginner
    --------

    Summary: Good algorithm, well done.

    Code Review: None for this task

    Correctness: 10
    Speed: 10
    Elegance: 10
    Portability: 10


    Intermediate
    ------------

    Summary: XSquared completely missed the point of arbitrary length numbers.

    Code Review: Maybe it's just me, but declaring
    Code:
    typedef double Integer;
    and then working with Integers using the built in arithmetic operators doesn't quite cut it. Expecially when my tests used number strings along the lines of "100000000000000000000000000000000000000000000 00".

    XSquared also tried to return a locally declared array, thus crashing my test program. Not conductive to good scores, sorry.

    Correctness: 0
    Speed: 0
    Elegance: 0
    Portability: 5


    Advanced
    --------

    Summary: XSquared completely missed the point of arbitrary length numbers.

    Code Review: See Intermediate comments

    Correctness: 0
    Speed: 0
    Elegance: 0
    Portability: 5
    My best code is written with the delete key.

  4. #4
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    vasanth
    -------

    Beginner
    --------

    Summary: Not bad, I expected the use of digRev from the last contest though. The only problem is that it slows things down a bit.

    Code Review: I wondered about the use of n = n + rev(n);, it caught me off guard when n += rev(n); would work just as well and be less likely to trip up readers.

    Correctness: 10
    Speed: 7
    Elegance: 9
    Portability: 9


    Intermediate
    ------------

    Summary: Once again, the purpose is not to rename int to Integer, but to create a type that represents numbers of any length (until you run out of memory).

    Code Review: None for this task

    Correctness: 5
    Speed: 5
    Elegance: 0
    Portability: 10


    Advanced
    --------

    Summary: Once again, the purpose is not to rename int to Integer, but to create a type that represents numbers of any length (until you run out of memory).

    Code Review: None for this task

    Correctness: 5
    Speed: 5
    Elegance: 0
    Portability: 10
    My best code is written with the delete key.

  5. #5
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    Sean345
    -------

    Intermediate
    ------------

    Summary: One of the few entries that actually did as requested. Nice algorithm, well implemented. Could be faster, but still nice.

    Code Review: None for this task

    Correctness: 10
    Speed: 7
    Elegance: 8
    Portability: 10
    My best code is written with the delete key.

  6. #6
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    ygfperson
    ---------

    Beginner
    --------

    Summary: I like your attempt to "cut corners", but all in all the algorithm was the slowest of the batch.

    Code Review: None for this task

    Correctness: 10
    Speed: 6
    Elegance: 9
    Portability: 9


    Intermediate
    ------------

    Summary: Nice algorithm. I like how you reused addInteger to implement subInteger.

    Code Review: None for this task

    Correctness: 8 (Works well in most cases)
    Speed: 9
    Elegance: 7 (Looks like a decent solution)
    Portability: 8 (Uses C99 which isn't heavily implemented)
    Last edited by Prelude; 08-10-2003 at 11:47 AM.
    My best code is written with the delete key.

  7. #7
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    ClownPimp
    ---------

    Intermediate
    ------------

    Summary: The first entry to meet requirements as well as run quickly. Very nice work.

    Code Review: None for this task

    Correctness: 10
    Speed: 10
    Elegance: 10
    Portability: 9 (Assumes that int can hold 1000000000)


    Advanced
    --------

    Summary: Nice implementation, but the speed suffers considerably with longer numbers. A different algorithm could have solved this problem.

    Code Review: None for this task

    Correctness: 10
    Speed: 8
    Elegance: 9
    Portability: 9 (Assumes that int can hold 1000000000)
    My best code is written with the delete key.

  8. #8
    Its not rocket science vasanth's Avatar
    Join Date
    Jan 2002
    Posts
    1,683
    wow.. i guess the question needs to be more specific.. because the question said "Integer are irrelevant as long as the interface is as above".. well i guess i did not bother about the length.. any way....


    Nice review.. but the review style of previous contest was better...

    and yes i would like my source to be reviewed so that i can learn and correct my mistakes..

  9. #9
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >but the review style of previous contest was better...
    I agree, but I was totally not feeling up to it at the time. And getting the results out by the deadline was my top priority. Sorry. I think maybe I'll hire Hammer or whoie or someone else who's pedantic to do the reviews when I'm overwhelmed. That's a good idea, I'll start taking applications immediately.

    >because the question said "Integer are irrelevant as long as the interface is as above"
    And right before that it said:
    Your task is to create an integer type of arbitrary length
    Of course, I don't care if you simply typedef int as Integer and implement the interface that way, but you wouldn't get good scores because it wouldn't be able to handle arbitrary lengths.

    >i guess the question needs to be more specific..
    I don't see how I could be more so. I made it very clear that the tests would use very large numbers in three ways:
    makeInteger("12345");
    By using a string, I imply that int, double, even long double are all too small to hold some values. This is a stretch, but still...
    create an integer type of arbitrary length
    This is the most explicit I could be.
    run in a reasonable amount of time for very large numbers
    This tells you that I'm going to make sure it does so by actually using huge numbers.
    My best code is written with the delete key.

  10. #10
    Its not rocket science vasanth's Avatar
    Join Date
    Jan 2002
    Posts
    1,683
    thanx..
    i think you can forget about my code review.. dont want to burden you.. When will the next contest start... Cant wait

  11. #11
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,490
    Why didn't my source compile? I don't have access to the microsoft C compiler, but GCC compiles it with no errors.

    Oh... I used a variable length array in the program. It's allowed in C99, isn't it?

    Anyway, uncomment the line 'zip_start = (block_t*)calloc... ', and comment the three lines below that one. This way it should run fine on all compilers.

    (On another note, I needed to add a '+1' to every malloc and calloc (besides the char* one)... that's my own dumb mistake, and that'll probably crash the program with a false 'out of memory' error.)

  12. #12
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,490
    Here's the code with the changes I talked about

  13. #13
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    How come you didn't post the source code this time? I really wanted to see ClownPimp's source.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  14. #14
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >I don't have access to the microsoft C compiler, but GCC compiles it with no errors.
    I was in a hurry and didn't test it on GCC. However, VC++ 6 didn't like your use of max as a macro, nor your use of snprintf (which is only standard in C99). However, it is fast now that I've tested it, but it has a few problems with long strings of 0's. I'll update the scores.
    My best code is written with the delete key.

  15. #15
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    Kudos to golfinguy who, sadly, submitted too late to be judged. However, the entry was creative (if difficult to expand upon and dangerous with unchecked array boundaries):
    Code:
    //very simple, just a look-up table
    int palNum(int i)
    {     static int array[50]={0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 11, 33, 44, 55, 66, 77, 88, 99,
                          121, 22, 33 ,22, 55, 66, 77, 88, 99, 121, 121, 33, 44, 55, 33, 77, 88,
                          99, 121, 121, 363, 44, 55, 66, 77, 44, 99, 121, 121, 363, 484};
          return *(array + i);
    }
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 72hour GDC Results
    By jverkoey in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 07-05-2004, 11:46 PM
  2. ADC #4 Results
    By Prelude in forum Contests Board
    Replies: 9
    Last Post: 08-28-2003, 01:38 PM
  3. ADC #3 Results
    By Prelude in forum Contests Board
    Replies: 19
    Last Post: 08-18-2003, 11:25 PM
  4. ADC #1 Results
    By Prelude in forum Contests Board
    Replies: 26
    Last Post: 08-06-2003, 03:57 AM
  5. Same seed for srand yields different results
    By codegirl in forum C++ Programming
    Replies: 3
    Last Post: 06-23-2003, 02:39 PM