Results 1 to 15 of 15
  1. #1
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky

    [CONTEST]Program of the Week - Week 49[DISCUSS]

    Happy numbers!

    Quote Originally Posted by wikipedia
    Starting with any positive integer, replace the number by the sum of the squares of its digits, and repeat the process until the number equals 1 (where it will stay), or it loops endlessly in a cycle which does not include 1. Those numbers for which this process ends in 1 are happy numbers, while those that do not end in 1 are unhappy number
    This weeks program should write all happy numbers below 10000 into "output.txt".

    Upload your code on pastebin and PM(!) me a link.

    People who have solved it:
    doofbla solution
    Jason's VB solution
    Hell_Daddy's solution

    ~ Thread is open for discussion as this was the last POTW >.> ~
    Last edited by Hell_Demon; 12-15-2010 at 08:46 AM.
    Ah we-a blaze the fyah, make it bun dem!

  2. The Following 5 Users Say Thank You to Hell_Demon For This Useful Post:

    ғᴜᴋᴏᴊʀ (12-06-2010),doofbla (12-06-2010),Jason (12-07-2010),NextGen1 (12-07-2010),why06 (12-16-2010)

  3. #2
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    VB is boss,

    Nice solution, Hell_Daddy and Doofbla. I like reading H_D's comments

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  4. #3
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    Good job those who solved it. Look forward to more, Good job H_D


     


     


     



    The Most complete application MPGH will ever offer - 68%




  5. #4
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    Quote Originally Posted by NextGen1 View Post
    Look forward to more, Good job H_D

    Maybe in the far future, cause it doesn't seem to attract anyone, only doofbla and jason solved both POTW's
    Ah we-a blaze the fyah, make it bun dem!

  6. #5
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    We need POTW to be in all programming sections (or at least VB/C++ sections, because they have the largest activity.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  7. #6
    258456's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    ghjghj
    Posts
    1,222
    Reputation
    18
    Thanks
    300
    My Mood
    Relaxed
    honestly, i don't get involved in it cuz i learned c++ from Liberty's book, and it doesn't get that in to the SDL i think it's called. I didn't learn c++ in a class like most of you, so i just moved on to the winapi, so winapi programs would be fun, or programs that are interesting, not removing certain numbers from a text file. That's just my opinion, i hope no one's offended.

  8. #7
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Goodjob to everyone that participated. Everyone else sucks

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  9. #8
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by 258456 View Post
    honestly, i don't get involved in it cuz i learned c++ from Liberty's book, and it doesn't get that in to the SDL i think it's called. I didn't learn c++ in a class like most of you, so i just moved on to the winapi, so winapi programs would be fun, or programs that are interesting, not removing certain numbers from a text file. That's just my opinion, i hope no one's offended.
    I've never taken a programming class or read a programming book in my life

    The fun in this sort of programming is the logic, if you don't like logic....I guess that's your loss because it's a key part of any programming challenge. I don't think many people around here took C++ classes anyway. Looking at HDs and doofbla's solutions, none of it seems to be confined to any type of C++ programming (for-loops, if, etc..)

    You can easily make this a console application and write to the output file.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  10. #9
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    Quote Originally Posted by Jason View Post
    Looking at HDs and doofbla's solutions, none of it seems to be confined to any type of C++ programming (for-loops, if, etc..)
    I've read 1 book, 9 years ago. The rest I've learned from just toying around
    Ah we-a blaze the fyah, make it bun dem!

  11. #10
    doofbla's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    Biel*****/Germany
    Posts
    369
    Reputation
    10
    Thanks
    179
    My Mood
    Psychedelic
    Quote Originally Posted by Hell_Demon View Post
    I've learned from just toying around
    That's how I learned too And how I'm still learning...
    And sometimes endless time spent on google

    You can't never finish learning
    _____________________________________________

    READING TUTORIAL:

    1. READ MY POST
    2. THINK ABOUT MY POST
    3. PRESS THANKS
    4. MAYBE CORRECT MY POSTS :P




    Dijkstra:
    "Computer Science is no more about computers than astronomy is about
    telescopes."


    THANKS BUTTON RIGHT DOWN --->

  12. #11
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by doofbla View Post
    You can't never finish learning
    Double negative

    You can't finish learning.

    Grammar nazi

    @HD + doofbla I agree completely, learning by doing is the bomb.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  13. The Following 2 Users Say Thank You to Jason For This Useful Post:

    doofbla (12-17-2010),Hell_Demon (12-17-2010)

  14. #12
    doofbla's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    Biel*****/Germany
    Posts
    369
    Reputation
    10
    Thanks
    179
    My Mood
    Psychedelic
    Is smth. from this right?

    "You can never finish learning?"
    "You can't ever finish learning?"
    _____________________________________________

    READING TUTORIAL:

    1. READ MY POST
    2. THINK ABOUT MY POST
    3. PRESS THANKS
    4. MAYBE CORRECT MY POSTS :P




    Dijkstra:
    "Computer Science is no more about computers than astronomy is about
    telescopes."


    THANKS BUTTON RIGHT DOWN --->

  15. The Following User Says Thank You to doofbla For This Useful Post:

    Hell_Demon (12-17-2010)

  16. #13
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    Quote Originally Posted by doofbla View Post
    Is smth. from this right?

    "You can never finish learning?"
    "You can't ever finish learning?"
    Both are correct
    Ah we-a blaze the fyah, make it bun dem!

  17. The Following User Says Thank You to Hell_Demon For This Useful Post:

    doofbla (01-07-2011)

  18. #14
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by doofbla View Post
    Is smth. from this right?

    "You can never finish learning?"
    "You can't ever finish learning?"
    You can never finish learning correct!
    You can't ever finish learning correct!
    You can't never finish learning bull fucking shit


    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  19. #15
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Quote Originally Posted by Jason View Post

    You can't never finish learning bull fucking shit
    Except in real life people talk like this all the time.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower