• Amused
  • Angry
  • Annoyed
  • Awesome
  • Bemused
  • Cocky
  • Cool
  • Crazy
  • Crying
  • Down
  • Drunk
  • Embarrased
  • Enraged
  • Friendly
  • Geeky
  • Godly
  • Happy
  • Hateful
  • Hungry
  • Innocent
  • Meh
  • Piratey
  • Poorly
  • Sad
  • Secret
  • Shy
  • Sneaky
  • Tired
  • Wtf
  • At Work
  • CodenzHub
  • Coding
  • Deejaying
  • Donating
  • Drinking
  • Eating
  • Editing
  • Hacking
  • Hate Mailing
  • Jamin'
  • Lagging
  • Live Streaming
  • Lurking
  • No Status
  • Pawning
  • PC Gaming
  • PS Gaming
  • Raging
  • Reversing
  • Sleeping
  • Steam Gaming
  • Trolling
  • TwitchStreamer
  • Vodka!
  • Watching TV/Movie
  • Xbox Gaming
  • Youtuber
  • Zombies
  • Page 1 of 3 123 LastLast
    Results 1 to 10 of 22
    1. #1
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      baseball435's Avatar
      Join Date
      Jun 2012
      Posts
      17
      Thanks (-->)
      1
      Thanks (<--)
      0

      C++ Challenges - Advanced

      John Kittz
      [list]Hey everyone, so I have a few challenges for you and all of them are more for the advanced C++ programmer. Try not to use Google if you can. When you are done post your solution and which challenge it is for. Here are the rules:

      Rules:
      • No use of any functions
      • No use of the '%', '*', and '/' operators
      • No use of any classes


      The challenges below should be placed in their own method and you should try and make it as small as you can, 1 line being the best if possible. Here are the challenges:

      Challenges:
      1. Make a function that takes a number as a parameter. Return an integer that is the power of two of the inputted number. So for example if the parameter is 5, it will return 25.
      2. Make a function that takes a number as a parameter. Return an integer that is the number divided by two. So for example if the parameter is 10, it will return 5.
      3. Make a function that takes a number as a parameter. Return a boolean value where true will be returned if the parameter is even or false if the parameter is odd. So for example if the parameter is 3 it will return false because it is odd.


      HINT:
      [spoiler]
      Use Bitwise operators!!!
      [/spoiler]

      Goodluck Everyone!
      ~Baseball435

    2. #2
      Coder
      Learning to hack games!
       
      Feeling Normal
       
      BlackPitchPL's Avatar
      Join Date
      May 2012
      Location
      POLAND
      Posts
      171
      Thanks (-->)
      1
      Thanks (<--)
      14

      Re: C++ Challenges - Advanced

      You tell us to not use function but in quest u tell us to write function :P

      Code:
      #include &lt;iostream&gt;
      #include &lt;conio.h&gt;
      #include &lt;math.h&gt;
      using namespace std;
      int main()
      {
        double number;
        cout &lt;&lt; "Enter number to pow: ";
        cin &gt;&gt; number;
        cout &lt;&lt; "pow(" &lt;&lt; number &lt;&lt; ")=" &lt;&lt; pow(number,2) &lt;&lt; endl;
       
        return( 0 );
      }

    3. #3
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      boogie's Avatar
      Join Date
      May 2012
      Posts
      23
      Thanks (-->)
      0
      Thanks (<--)
      1

      Re: C++ Challenges - Advanced

      He probably ment external functions like "pow".
      League of Legends - Eu West Player

    4. #4
      Coder
      Learning to hack games!
       
      Feeling Normal
       
      guru's Avatar
      Join Date
      Jun 2012
      Posts
      117
      Thanks (-->)
      7
      Thanks (<--)
      20

      Re: C++ Challenges - Advanced

      solution for your first question. The code is in c#
      I did it c# since the vc# ide was open when I read this post. So don't say "Ah! c#? I asked in c++". The point is your problem getting solved.

      public int pow(int i) //c++ equivalent
      {
      int j;
      p=0
      for(j=0;j&lt;i;j++)
      {
      p=p+i;
      }
      return p;
      }
      [spoiler]
      using System;
      class MainCall
      {
      public static void Main()
      {
      int a,p=0;
      a=Convert.ToInt32(Console.ReadLine());
      for (int j = 0; j &lt; a; j++) // This is the core stuff. This loop perform the power function use this loop within any function
      {
      p = p + a;
      }
      Console.WriteLine("The answer is {0}",p);
      Console.ReadLine();
      }
      }
      [/spoiler]

    5. #5
      Coder
      Learning to hack games!
       
      Feeling Normal
       
      guru's Avatar
      Join Date
      Jun 2012
      Posts
      117
      Thanks (-->)
      7
      Thanks (<--)
      20

      Re: C++ Challenges - Advanced

      And about your third problem:

      public bool eoo(int i) // c++ equivalent
      {
      int j;
      for(j=0;j&lt;=i;j=j+2)
      {
      if(j==i)
      {
      return true;
      }
      else
      {
      continue;
      }
      }
      return false;
      }

      The code is in c#:
      [spoiler]
      using System;
      class MainCall
      {
      public static void Main()
      {
      int a,p=0;
      a=Convert.ToInt32(Console.ReadLine());
      FunctionEX fe = new FunctionEX();
      Console.WriteLine(fe.eoo(a));
      Console.ReadLine();
      }
      }

      class FunctionEX
      {
      public bool eoo(int i)
      {
      for (int j = 0; j &lt;= i; j = j + 2)
      {
      if (j == i)
      {
      return true;
      }
      else
      {
      continue;
      }
      }
      return false;
      }
      }
      [/spoiler]

    6. #6
      Hacker
      Retired
       
      Pawning
       
      Crazywink's Avatar
      Join Date
      Jul 2012
      Location
      US
      Posts
      647
      Thanks (-->)
      111
      Thanks (<--)
      226

      Re: C++ Challenges - Advanced

      Solution for the second, C++.
      Code:
      #include &lt;iostream&gt;
      using namespace std;
      int main()
      {
      	unsigned int Value;
      	cout &lt;&lt; "Enter value to be divided: ";
      	cin &gt;&gt; Value;
      	Value = Value &gt;&gt; 1;
      	cout &lt;&lt; "\n" &lt;&lt; "Your new value is: " &lt;&lt; Value &lt;&lt; "\n";
      }

      Crazywink

    7. #7
      Coder
      Learning to hack games!
       
      Feeling Normal
       
      guru's Avatar
      Join Date
      Jun 2012
      Posts
      117
      Thanks (-->)
      7
      Thanks (<--)
      20

      Re: C++ Challenges - Advanced

      @Crazywink: is there any other method available other than bit operations?
      Btw, Nice and a simple one!

    8. #8
      Hacker
      Retired
       
      Pawning
       
      Crazywink's Avatar
      Join Date
      Jul 2012
      Location
      US
      Posts
      647
      Thanks (-->)
      111
      Thanks (<--)
      226

      Re: C++ Challenges - Advanced

      [quote author=guru link=topic=643.msg4098#msg4098 date=1345835214]
      @Crazywink: is there any other method available other than bit operations?
      Btw, Nice and a simple one!
      [/quote]
      Thanks
      You mean another method that doesn't use "/" or bit operation?

    9. #9
      Coder
      Learning to hack games!
       
      Feeling Normal
       
      guru's Avatar
      Join Date
      Jun 2012
      Posts
      117
      Thanks (-->)
      7
      Thanks (<--)
      20

      Re: C++ Challenges - Advanced

      Ya! Just trying an out of box solution. He has gave an hint that to use bit wise operator. Apart from bit wise, is it possible to solve the 2nd problem without bit wise operation?

    10. #10
      Hacker
      Retired
       
      Pawning
       
      Crazywink's Avatar
      Join Date
      Jul 2012
      Location
      US
      Posts
      647
      Thanks (-->)
      111
      Thanks (<--)
      226

      Re: C++ Challenges - Advanced

      Cheats'n'Trainers
      [quote author=guru link=topic=643.msg4101#msg4101 date=1345835688]
      Ya! Just trying an out of box solution. He has gave an hint that to use bit wise operator. Apart from bit wise, is it possible to solve the 2nd problem without bit wise operation?
      [/quote]
      Hmmm.. That's a tough one.. Not being able to use "*", "/" and "%" and bit operators.. Pretty much leaves you with "+" and "-". XD
      I'm going to keep thinking on this though..

      Crazywink

    Page 1 of 3 123 LastLast

    Similar Game Hacker Threads

    1. Call of Duty 1 1.5 Advanced SP Trainer ESP
      By rapt0r in forum Call of Duty Cheating
      Replies: 0
      Last Post: 07-12-2015, 07:14 AM
    2. [CSGO] Advanced System Aimbot+Triggerbot
      By hexenos in forum CS:GO Hacks
      Replies: 3
      Last Post: 05-30-2015, 03:27 PM
    3. [Release] Advanced Injector V2.1
      By Ahmed.y in forum Hacking Tools
      Replies: 11
      Last Post: 06-18-2012, 09:07 AM