Thread: Underhanded C contest

  1. #1
    Supermassive black hole cboard_member's Avatar
    Join Date
    Jul 2005
    Posts
    1,709

    Underhanded C contest

    http://www.brainhz.com/underhanded/

    Anyone going to enter? I know I'm not - wouldn't have a clue where to start to be honest.
    Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.

    - Mike McShaffry

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    > wouldn't have a clue where to start to be honest.
    <tease>I could make a suggestion....</tease>
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Supermassive black hole cboard_member's Avatar
    Join Date
    Jul 2005
    Posts
    1,709
    Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.

    - Mike McShaffry

  4. #4
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    What a dumb contest.

  5. #5
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    A. Choose a platform that uses a ram-drive for file storage.
    B. Choose a platform that uses punch cards for file storage.
    C. Write a few gigabytes of temporary data to file.

  6. #6
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by anonytmouse
    A. Choose a platform that uses a ram-drive for file storage.
    B. Choose a platform that uses punch cards for file storage.
    C. Write a few gigabytes of temporary data to file.
    Wont get the extra points for "genuinely OS-dependent, rather than hardware-dependent."
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  7. #7
    the Great ElastoManiac's Avatar
    Join Date
    Nov 2005
    Location
    Republika Srpska - Balkan
    Posts
    377
    Quote Originally Posted by Bubba
    What a dumb contest.
    Have to agree, though it's pretty funny!
    lu lu lu I've got some apples lu lu lu You've got some too lu lu lu Let's make some applesauce Take off our clothes and lu lu lu

  8. #8
    Registered User
    Join Date
    Mar 2006
    Posts
    725
    Now I've seen everything......
    Code:
    #include <stdio.h>
    
    void J(char*a){int f,i=0,c='1';for(;a[i]!='0';++i)if(i==81){
    puts(a);return;}for(;c<='9';++c){for(f=0;f<9;++f)if(a[i-i%27+i%9
    /3*3+f/3*9+f%3]==c||a[i%9+f*9]==c||a[i-i%9+f]==c)goto e;a[i]=c;J(a);a[i]
    ='0';e:;}}int main(int c,char**v){int t=0;if(c>1){for(;v[1][
    t];++t);if(t==81){J(v[1]);return 0;}}puts("sudoku [0-9]{81}");return 1;}

  9. #9
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    This reminded me of something I saw in the MSVC express start page. Looks like microsoft are actively encouraging the creation of malware
    http://msdn.microsoft.com/coding4fun/april-fools/

  10. #10
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    I really hope you're not serious.

  11. #11
    Dump Truck Internet valis's Avatar
    Join Date
    Jul 2005
    Posts
    357
    A. Choose a platform that uses a ram-drive for file storage.
    B. Choose a platform that uses punch cards for file storage.
    C. Write a few gigabytes of temporary data to file.
    Those are all things that would be caught easily.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Expression Evaluator Contest
    By Stack Overflow in forum Contests Board
    Replies: 20
    Last Post: 03-29-2005, 10:34 AM
  2. Obfuscated Code Contest
    By Stack Overflow in forum Contests Board
    Replies: 51
    Last Post: 01-21-2005, 04:17 PM
  3. WANTED: Contest Master
    By kermi3 in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-23-2003, 10:15 PM