#1
  1. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,594
    Rep Power
    4207

    Scorpy's C/C++ Puzzle of the Week [UPDATED - July 3rd 2011]


    Right Lasses and Laddies,
    I'm starting off a new column here. Every week (or whenever time permits), I'll present a puzzle of the week. First person or people to answer that puzzle correctly will appear in my signature for a week.

    The puzzles may be posted in the context of some other problem, or they may occupy threads of their own. This thread will contain links to the latest puzzle of the week.

    Puzzles (push down list):
    Puzzle 9 <-- Currently running.
    Puzzle 8 <-- Solved by Nyan, lackoblacko and jwdonahue
    Puzzle 7 <--- Solved by L7Sqr, Sizeablegrin and Etienne141
    Puzzle 6 <--- Solved by no one
    Puzzle 5 <--- Solved by nattylife.
    Puzzle 4 <-- Solved by Lux Perpetua, Kitkat77 and Oler1s
    Puzzle 3 <--- Solved by many people.
    Puzzle 2 Solved by ComputerPhreak
    Puzzle 1 Solved by Kicken and ComputerPhreak

    Enjoy!

    Comments on this post

    • codergeek42 agrees : Awesome idea!
    • kicken agrees : happy happy joy joy. :)
    • Lux Perpetua agrees : Yay. :)
    • ComputerPhreak agrees : Moo!
    • dotancohen agrees : This should be fun when I get to that level.
    • ulmo_sea_lord disagrees : wtf is wrong with u faggot...
    Last edited by Scorpions4ever; July 2nd, 2012 at 03:43 PM.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  2. #2
  3. המבין יבין
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 2001
    Location
    Haifa
    Posts
    2,085
    Rep Power
    1485
    Eddy -er- Scorpion, any chance of doing something similar, but on a simpler level? I'm just learning C, and although I love puzzles, I'm not quite up to the level of solving these.
    . . . What is Firefox?
    . . . . . . What is Linux?
    . . . . . . . . . . . What is Love?
  4. #3
  5. No Profile Picture
    Redpill
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Nov 2005
    Posts
    1,660
    Rep Power
    151
    Hehe, that's not fun. @Scorps: try making some *harder* ones. Like, having to do with caching, subtle function side effects, unusual syntax constructs...

    Comments on this post

    • peenie agrees
    Code:
    #include <stdio.h>
    int main(int o,char**O){return o>-1?o-2||!main(-1,1+O)?!!fprintf(stderr,"%s [0-"
    "9]{81}\n",*O):main(-83,++O):o>-83?(*O)[-1-o]?81==(o=-o-1)||o[*O]<'0'||'9'<o[*O]
    ?0:main(-2-o,O):o==-82:o>-164?(*O)[-83-o]<'1'?main(o-82,O):main(--o,O):o+164?o>-
    246?(*O)[-165-o]<'1'?main(o-82,O):main(--o,O):o+246?o>-328?(*O)[o=-o-247]<='8'?(
    main(-328-o,(++o[*O],O)),main(-247-o,O)):!(o[*O]='0'):(o=-o-328)<729?(o%9/3*3-o%
    27+o/243*9+o/81%3&&(*O)[o%81]==(*O)[o%81-o%27+o%9/3*3+o/243*9+o/81%3])||(o%81-o%
    9-o/81*9&&(*O)[o%81]==(*O)[o%9+o/81*9])||(o/81-o%9&&(*O)[o%81]==(*O)[o%81-o%9+o/
    81])?0:main(-409-o,O):main(-165-o%81,O):!puts(*O):0                           ;}
  6. #4
  7. Google Relay Server
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Oct 2003
    Location
    Oh christ I don't even know any more.
    Posts
    1,812
    Rep Power
    438
    If anybody's looking for some good brainwork, btw, check out Project Euler. I've wasted lots of hours there but the problems are pretty good; there's a wide range of difficulty. It tracks the ones you complete and tallies a score too.

    Er -- hope I'm not spamming this thread with this one but it seems relevant.
    OMG RAVER CHICKS!!
    On a related note: C/C++ Programming Tutorials


    "Science is based on reality staying the same, and Nature ignores what humans vote upon." -- Bill Beaty
    "Three litres of sherry up the butt can only be described as astounding." -- Darwin Awards
  8. #5
  9. No Profile Picture
    Turning coffee into code
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2005
    Location
    UT Austin, TX
    Posts
    164
    Rep Power
    94
    Originally Posted by peenie
    If anybody's looking for some good brainwork, btw, check out Project Euler. I've wasted lots of hours there but the problems are pretty good; there's a wide range of difficulty. It tracks the ones you complete and tallies a score too.

    Er -- hope I'm not spamming this thread with this one but it seems relevant.
    Thanks for the link that was fun. I just did the first 19 (sorted by difficulty) in one sitting

    Edit: Day 2 I'm up to 48 done.

    Comments on this post

    • peenie agrees : yeah every few weeks i sit down and crank a bunch of them out; its pretty addicting.
  10. #6
  11. No Profile Picture
    Closet coder
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Feb 2005
    Location
    Plantation, FL <---south florida
    Posts
    1,431
    Rep Power
    153

    Smile


    whens the next one scorpy? its been a while
  12. #7
  13. Career Newbie
    Devshed Novice (500 - 999 posts)

    Join Date
    Dec 2005
    Location
    Klamath Falls, Oregon
    Posts
    643
    Rep Power
    11
    Quite a while
  14. #8
  15. No Profile Picture
    Banned
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2008
    Location
    MD, Whiteford
    Posts
    27
    Rep Power
    0
    This sounds like a great idea. Im prob gonna check it out. I may take a leaf out of your book and do something like this in the Java section some day :P

IMN logo majestic logo threadwatch logo seochat tools logo