Here's another one...

This is a discussion on Here's another one... within the A Brief History of Cprogramming.com forums, part of the Community Boards category; This is probably so simple it's not funny, but you never know. Code: int varible = 0; int main(void) { ...

  1. #1
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342

    Lightbulb Here's another one...

    This is probably so simple it's not funny, but you never know.
    Code:
    int varible = 0;
     
    int main(void)
    {
       hello fellow programmer
    }
    Make the code in the main function add one to the varible varible, without adding anything to main or using classes or structs.

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >This is probably so simple it's not funny
    Yes, yes it is. It's also pretty pointless seeing as how you won't learn anything significant from solving the puzzle.
    My best code is written with the delete key.

  3. #3
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342
    Lighten up, we are in the General Discussions board, not everything you learn here has to be significant. And if it's so easy, then why not solve this "pointless puzzle"?

  4. #4
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >Lighten up, we are in the General Discussions board, not everything you learn here has to be significant
    I was simply stating an observation. There's no need to get defensive.

    >And if it's so easy, then why not solve this "pointless puzzle"?
    For the same reason that I don't participate in contests that I'm overqualified for. If I throw together a solution in a few seconds then it sucks the fun right out of the exercise for the people who are actually interested in figuring it out.
    My best code is written with the delete key.

  5. #5
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,510
    There is very little interesting about this exercise actually. I prefer puzzles that actually can be used in real-life situations (and are more challenging that just mimic language features). This one is pointless.

    But still...

    Code:
    #define hello varible
    #define fellow +=
    #define programmer 1;
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  6. #6
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342
    >> I was simply stating an observation. There's no need to get defensive.

    Oh.

    It's just that where I come from (my family), no one makes an observation, it's always an aggresive comment, so I am automaticly always in defense mode.

  7. #7
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342
    >> This one is pointless.

    I guess it is.

    Oh well, maybe my other thread isn't...

  8. #8
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,262
    Heh, my family too

    I think I'll copy your poll idea in relation to my signature.

  9. #9
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342
    >> Heh, my family too

    Well, it's always good to know I'm not alone.

  10. #10
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >It's just that where I come from (my family), no one makes an observation, it's always an aggresive comment
    Hmm, my family is just super competitive about everything. Holidays together are always entertaining.
    My best code is written with the delete key.

  11. #11
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342
    Especially siblings. Take from me, I know, I've got 4 bubs (little brothers)!
    Last edited by Queatrix; 09-17-2006 at 06:56 PM.

  12. #12
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,262
    Heh, I've 5 older brothers and sisters I guess I was the brat hehe

  13. #13
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,510
    I'm the only man in my house. Even the damn cat is a she. My wife and daughter... well, in short, Electra never had a saying.

    ... so I take it on the forums
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  14. #14
    Registered User whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    7,738
    I can relate to Mario's feelings. I'm the only male in this generation of my family. I'm lonely.

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

    - Mike McShaffry

Page 1 of 2 12 LastLast
Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21