Page 1 of 3 123 LastLast
Results 1 to 15 of 33
  1. #1
    scimmyboy's Avatar
    Join Date
    Jan 2008
    Gender
    male
    Location
    https://mpgh.net MPGHCash: $442,596,199
    Posts
    5,645
    Reputation
    26
    Thanks
    896
    My Mood
    Happy

    MPGH Logistic Programming Challenge

    Me, Void, and User1 have been racing to the finish on programs that involve high amounts of preparation and logical thinking to program. Seemingly simple projects may prove to be more difficult than you think.

    The main focus of these projects is to use the basic C++ compiler options and make programs that fit the requirements of the challenge. Use this opportunity to think outside the box. Both beginning and advanced programmers can participate.

    So here is the first challenge:
    Fibonacci Sequence

    If you don't know what the Fibonacci Sequence is, refer to this Wikipedia link: Fibonacci number - Wikipedia, the free encyclopedia
    Basically, you can find a number in a sequence by adding the two numbers before it together.
    Your job is to make a program that is able find the nth term of the Fibonacci Sequence.

    Paste your code into a reply when you are done.
    More challenges will come as we come up with more ideas through Skype.

  2. #2
    faceofdevil's Avatar
    Join Date
    Jul 2009
    Gender
    female
    Posts
    77
    Reputation
    9
    Thanks
    6
    something like this??

    Code:
    int number( int nth )
    {
          if( nth<=1 )
          return nth;
          else
                return  number( nth - 1 ) + number( nth - 2 );
    }
    ofc to lazy to enter the user input but is that needed?

  3. #3
    scimmyboy's Avatar
    Join Date
    Jan 2008
    Gender
    male
    Location
    https://mpgh.net MPGHCash: $442,596,199
    Posts
    5,645
    Reputation
    26
    Thanks
    896
    My Mood
    Happy
    Quote Originally Posted by faceofdevil View Post
    something like this??

    Code:
    int number( int nth )
    {
          if( nth<=1 )
          return nth;
          else
                return  number( nth - 1 ) + number( nth - 2 );
    }
    ofc to lazy to enter the user input but is that needed?
    makes it easier on us. lol

  4. #4
    User1's Avatar
    Join Date
    Jul 2009
    Gender
    female
    Location
    Above the influence
    Posts
    4,065
    Reputation
    61
    Thanks
    4,294,967,295
    My Mood
    Crappy
    Did we tell you we finished Pascal's triangle... ofc i ended up getting it first... he finally got the algorithm after I enhanced my function and allowed user to specify how many levels to calculate... the numbers were HUGE after going to 90 levels.... Lucky I'm on a x64... usigned longs :P

    Oh and I have bragging rights now. LOL
    Any donations would help


    Quote Originally Posted by Bombsaway707

    HOLY SHIT ITS USER1
    Quote Originally Posted by Blood

    HOLY SHIT ITS USER1
    Quote Originally Posted by Alby-kun


    HOLY SHIT ITS USER1
    Quote Originally Posted by Ali

    HOLY SHIT ITS USER1
    Quote Originally Posted by CodeDemon
    HOLY SHIT ITS USER1
    Quote Originally Posted by Jussofresh View Post
    HOLY SHIT ITS USER1!
    [21:13] CoderNever: HOLY SHIT ITS USER1!

  5. #5
    Toxic Waltz's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    114
    Reputation
    14
    Thanks
    18
    Code:
    #include <iostream>
    
    using namespace std;
    
    int main()
    {
        int nth=0;
        long long unsigned int first = 0, second =1, total = 0;
        cout<<"nth?"<<endl;
        cin>>nth;
        
        for(int i=1; i<nth; i++)
        {
               total=first + second;
               first=second;
               second = total;
        }
        
        cout<<total;
        system("pause");
        return 0;
    }

  6. #6
    scimmyboy's Avatar
    Join Date
    Jan 2008
    Gender
    male
    Location
    https://mpgh.net MPGHCash: $442,596,199
    Posts
    5,645
    Reputation
    26
    Thanks
    896
    My Mood
    Happy
    Quote Originally Posted by Toxic Waltz View Post
    Code:
    #include <iostream>
    
    using namespace std;
    
    int main()
    {
        int nth=0;
        long long unsigned int first = 0, second =1, total = 0;
        cout<<"nth?"<<endl;
        cin>>nth;
        
        for(int i=1; i<nth; i++)
        {
               total=first + second;
               first=second;
               second = total;
        }
        
        cout<<total;
        system("pause");
        return 0;
    }
    good job. exactly how i did it. level one passed

  7. #7
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    Those are the kind of exercises i had on my exams... ._. such as prime numbers too(ex). On my C exams
    Last edited by 'Bruno; 08-11-2010 at 07:25 PM.
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  8. #8
    scimmyboy's Avatar
    Join Date
    Jan 2008
    Gender
    male
    Location
    https://mpgh.net MPGHCash: $442,596,199
    Posts
    5,645
    Reputation
    26
    Thanks
    896
    My Mood
    Happy
    Quote Originally Posted by Brinuz View Post
    Those are the kind of exercises i had on my exams... ._. such as prime numbers too(ex). On my C exams
    wow ur good. prime numbers was one of the projects me void and user1 were working on yesterday afternoon

  9. #9
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    Quote Originally Posted by scimmyboy View Post
    wow ur good. prime numbers was one of the projects me void and user1 were working on yesterday afternoon
    i'm not that good... but i must say i hate those exercises.. ;s maybe because of exams /
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  10. #10
    Toxic Waltz's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    114
    Reputation
    14
    Thanks
    18
    Quote Originally Posted by scimmyboy View Post
    wow ur good. prime numbers was one of the projects me void and user1 were working on yesterday afternoon
    isn;t that difficult....

  11. #11
    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
    Code:
    #include <windows.h>
    #include <iostream>
    using namespace std;
    
    int WhatTheFuck(int lolwat);
    
    int main()
    {
        while(1)
        {
            int gtfo;
            cout<<"Input: ";
            cin>>gtfo;
            cout<<"Output: "<<WhatTheFuck(gtfo)<<endl;
        }
        return 1;
    }
    
    int WhatTheFuck(int lolwat)
    {
        if(lolwat<2) return 0;
        else return ((lolwat-1)+(lolwat-2));
    }
    can't be arsed to test

    edit - alternitive:
    Code:
    #include <windows.h>
    #include <iostream>
    using namespace std;
    
    int WhatTheFuck(int lolwat);
    
    int main()
    {
        cout<<"That guys sequence goes: ";
        for(int i=0;i<100;i++)
        {
            cout<<WhatTheFuck(i);
            if((i%10)==9) cout<<endl;
            else cout<<", ";
        }
        return 1;
    }
    
    int WhatTheFuck(int lolwat)
    {
        if(lolwat<2) return 0;
        else return ((lolwat-1)+(lolwat-2));
    }
    Last edited by Hell_Demon; 08-11-2010 at 09:52 PM.
    Ah we-a blaze the fyah, make it bun dem!

  12. #12
    Void's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Inline.
    Posts
    3,198
    Reputation
    205
    Thanks
    1,445
    My Mood
    Mellow
    Can't believe you're going through with this Justin. |:

    By the way, me and User1 have bragging rights over you until you finish the triangle.

  13. #13
    Toxic Waltz's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    114
    Reputation
    14
    Thanks
    18
    lol HD's code fails

  14. #14
    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 Toxic Waltz View Post
    lol HD's code fails
    The only thing I have read from this is:
    Quote Originally Posted by scimmy
    Basically, you can find a number in a sequence by adding the two numbers before it together.
    and



    so /care if it fails
    Ah we-a blaze the fyah, make it bun dem!

  15. #15
    ɑrtemis's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    arun's urethra
    Posts
    260
    Reputation
    24
    Thanks
    17
    My Mood
    Amused
    Quote Originally Posted by Void View Post
    Can't believe you're going through with this Justin. |:

    By the way, me and User1 have bragging rights over you until you finish the triangle.
    ./\
    /__\



    /

Page 1 of 3 123 LastLast

Similar Threads

  1. The Mpgh Login Background Challenge Poll!! VOTE NOW
    By bazookaboy in forum Combat Arms Mod Discussion
    Replies: 68
    Last Post: 09-08-2011, 02:01 PM
  2. [Discussion] The Mpgh Login Background Challenge!! Deadline: 9/5!!
    By bazookaboy in forum Combat Arms Mod Discussion
    Replies: 65
    Last Post: 09-05-2011, 04:57 PM
  3. The Mpgh Login Background Challenge!! Deadline: 9/5!!
    By bazookaboy in forum Combat Arms Mods & Rez Modding
    Replies: 10
    Last Post: 09-04-2011, 04:06 AM
  4. [Discussion] MPGH Login Background Challenge!
    By bazookaboy in forum Combat Arms Mod Discussion
    Replies: 52
    Last Post: 09-03-2011, 11:57 AM
  5. [Idea][Discussion] Programming Challenges.
    By Jason in forum Coders Lounge
    Replies: 67
    Last Post: 02-13-2011, 09:57 PM