How many people here are really programmers?

08/31/2009 07:39 _tao4229_#1
If you think you are, please post the answer to the equation:

2 ^ 2 = ?
08/31/2009 07:49 ookamocka#2
Quote:
Originally Posted by _tao4229_ View Post
If you think you are, please post the answer to the equation:

2 ^ 2 = ?
2 of course
08/31/2009 07:57 kinshi88#3
0
08/31/2009 08:33 ~*|Limbo|*~#4
2 ^ 2 = 4
08/31/2009 08:41 tribalost#5
0
08/31/2009 08:41 GraveDigger#6
that is an incorrect format. Should be from right to left.

? = 2 ^ 2
08/31/2009 09:35 rubenz#7
xD if in math 4
08/31/2009 12:43 onlyme64#8
After long hours of late night work, its 22...
08/31/2009 14:47 Rab#9
0
08/31/2009 14:49 _xTreme_#10
0
08/31/2009 14:55 Zion~#11
I think this depends on which language its being used in.
More or less, the answer is based on the language
The only time I've seen the XOR being used was in my friends CO encryption method.

I don't know... I'm not too fond of it.
08/31/2009 14:56 _MaryJuana#12
its 8
08/31/2009 14:57 Kane49#13
Quote:
Originally Posted by _tao4229_ View Post
If you think you are, please post the answer to the equation:

2 ^ 2 = ?
you probably aren't.

^ is completely syntax dependent, so its 100% clear the right answer is 42.
08/31/2009 15:23 tanelipe#14
PHP Code:
  public enum CalculateMode
        
{
            XOR = 
0,
            
Power
        
}
        public static 
sbyte CalculateAnswer(byte valueCalculateMode mode)
        {
            switch (
mode)
            {
                case 
CalculateMode.XOR:
                    return (
sbyte)(value value);
                case 
CalculateMode.Power:
                    return (
sbyte)Math.Pow(valuevalue);
            }
            return -
1;
        }
        public static 
void Main(string[] args)
        {
            try
            {
                
byte value 0;
                if (
byte.TryParse(args[0], out value))
                {
                    
CalculateMode mode = (CalculateMode)Enum.Parse(typeof(CalculateMode), args[1]);
                    if (
Enum.IsDefined(typeof(CalculateMode), mode))
                    {
                        
Console.WriteLine("'{0}' calculated with {1} is {2}"valuemode.ToString(), CalculateAnswer(valuemode));
                        
Console.ReadLine();
                    }
                    else
                    {
                        
Console.WriteLine("'{0}' is not defined in CalculateMode."mode.ToString());
                        
Console.ReadLine();
                    }
                }
                else
                {
                    
Console.WriteLine("'value' is invalid. Check first param.");
                }
            }
            catch (
ArgumentException)
            {
                
Console.WriteLine("mode wasn't defined in CalculateMode.");
                
Console.ReadLine();
            }
        } 
Have fun.
08/31/2009 15:48 Basser#15
This has to do with programming CO Private Servers?
If so, I'm not a programmer.