Jump to content

Coder Battle #2 - Results!

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
34 replies to this topic

#1
Guest_Jordan_*

Guest_Jordan_*
  • Guests
I know, it has been a long time since the results were submitted but here is the official thread announcing the winner!

Congratulations Amrosama for winning Coder Battle #2!

The reason
After mod/admin voting and testing it became apparent that Amrosama's code (using C#) sorted all input correctly while we were able to trick Outsid3r's code (using C++) into producing false results.

I've attached both code examples here and we will shortly be releasing Coder Battle #3.

Thank you and congratulations to both Ousid3r and Amrosama!

Attached Files



#2
Egz0N

Egz0N

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 4,034 posts
Congrats .. amr .. :)

#3
amrosama

amrosama

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 8,674 posts
yaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaay

im sure outsider would have done better if he had more time
thnx egzon
i wanna see more people competing in the next contest
yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
www.amrosama.com | the unholy methods of javascript

#4
Guest_Jordan_*

Guest_Jordan_*
  • Guests
Hopefully we can get at least 4 or more for the next battle.

#5
outsid3r

outsid3r

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 623 posts
Gz amrosama! btw jordan, what was the error of my program?

#6
Guest_Jordan_*

Guest_Jordan_*
  • Guests
There was no error outsid3r, it did not sort data correctly in some instances.

#7
outsid3r

outsid3r

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 623 posts

Jordan said:

There was no error outsid3r, it did not sort data correctly in some instances.

Can you be more especific?

#8
Guest_Jordan_*

Guest_Jordan_*
  • Guests
Using this CSV file:

20,"ABCDefg",1
20,"abcdEFG",1
1,"NUMBER1",20
1,"nuMber1",20
1,"NUMBER1",21
2,"NUMBER1",20
40,"last element",1
39,"SECond",1
14,"MIDdle",500
14,"middle",500
12,"abcdefghijklmnopqrstuvwxyz",1
12,"abcdefghijklmnopqrstuvwxyz",2
12,"abcdefghijklmnopqrstuvwxyz",10
16,"A10",1
16,"10",1
16,"B10",1
16,"10B",1
16,"a10",1
17,"1111111111",6
17,"1222222222",6

Your code truncates one item in append mode and notice the first item is incorrect. 1,"NUMBER1",20 should be first rather than 1,"NUMBER1",21.


1,"NUMBER1",21
1,"NUMBER1",20
1,"nuMber1",20
2,"NUMBER1",20
12,"abcdefghijklmnopqrstuvwxyz",10
12,"abcdefghijklmnopqrstuvwxyz",2
12,"abcdefghijklmnopqrstuvwxyz",1
14,"MIDdle",500
14,"middle",500
16,"10",1
16,"A10",1
16,"10B",1
16,"B10",1
16,"a10",1
17,"1111111111",6
17,"1222222222",6
20,"ABCDefg",1
20,"abcdEFG",1
39,"SECond",1
40,"last element",1

It should be
1,"NUMBER1",20
1,"NUMBER1",21
1,"nuMber1",20
2,"NUMBER1",20
12,"abcdefghijklmnopqrstuvwxyz",1
12,"abcdefghijklmnopqrstuvwxyz",2
12,"abcdefghijklmnopqrstuvwxyz",10
14,"MIDdle",500
14,"middle",500
16,"10",1
16,"10B",1
16,"A10",1
16,"B10",1
16,"a10",1
17,"1111111111",6
17,"1222222222",6
20,"ABCDefg",1
20,"abcdEFG",1
39,"SECond",1
40,"last element",1


#9
outsid3r

outsid3r

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 623 posts
yea you're right, since the other modes worked correctly i probably didn't check append mode.

#10
Guest_Jordan_*

Guest_Jordan_*
  • Guests
Probably just because you were rushed and made a change right at the end. Will you compete in the next battle?

#11
amrosama

amrosama

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 8,674 posts
say yes please
yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
www.amrosama.com | the unholy methods of javascript

#12
outsid3r

outsid3r

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 623 posts

Jordan said:

Probably just because you were rushed and made a change right at the end. Will you compete in the next battle?

I did this program very quickly, in the same day that you have anunciated this contest. Later, in the last day of the contest i was reading about sorting algorithms in wikipedia then i realised that there were more efficient sorting algorithms (previously i almost didn't have any knowledge about sorting, i just used an sorting algorithm that i learned long time ago then i was programming in python, i didn't even knew his name, it was bubble sort), so i just switched to selection sort which is much more faster than bubble sort, that was the only last hour change, previously i didn't have seen the append bug.
And of course that i will compete in the next battle :P, probably i will do again a command line program but i will check carefully all steps before i send you the program. btw do you prefer a program with GUI ?