Someone help me solve this C# code

Discussion in 'Programming General' started by I 1337 I, Mar 5, 2010.

Someone help me solve this C# code
  1. Unread #1 - Mar 5, 2010 at 11:53 AM
  2. I 1337 I
    Joined:
    Aug 18, 2007
    Posts:
    1,158
    Referrals:
    1
    Sythe Gold:
    0

    I 1337 I Guru
    Banned

    Someone help me solve this C# code

    E: Sorry, accidently made 2 topics because sythe.org lagged so I didnt notice that it already made a topic. Apologies

    Ok so theres 1 competition (Finnish one), i need to solve this C# CODE


    Mission: Find the new location for the righter (probably means the ball2) ball after the collision! The solution is hidden in the C # code. The final answer has to be crypted in the correct algothrim before entering it in the field.


    Code:
    private void InitializeComponents()
    {
    RootLayout.Width = 800; RootLayout.Height = 600;
    Ball1 = new Ball();
    Ball2 = new Ball();
    allBalls = new List<Ball>();
    Ball1.Width = Ball1.Height = 50;
    Ball1.Velocity.X = 3.0;
    Ball1.Name = "Ball1";
    Ball1.Shape.Width = Ball1.Shape.Height = 40;
    Ball1.Mass = Ball1.Shape.Width / Ball1.Width;
    Canvas.SetLeft(Ball1.Shape, -Ball1.Shape.Width / 2);
    Canvas.SetTop(Ball1.Shape, -Ball1.Shape.Height / 2);
    Canvas.SetLeft(Ball1, (Ball1.Shape.Width - Ball1.Width) / 2);
    Canvas.SetTop(Ball1, 275);
    RootLayout.Children.Add(Ball1);
    allBalls.Add(Ball1);
    
    
    Ball2.Velocity.X = -6.0;
    Ball2.Width = Ball2.Height = 50;
    Ball2.Name = "Ball2";
    Ball2.Shape.Width = Ball2.Shape.Height = 20;
    Ball2.Mass = Ball2.Shape.Width / Ball2.Width;
    Canvas.SetLeft(Ball2.Shape, -Ball2.Shape.Width / 2);
    Canvas.SetTop(Ball2.Shape, -Ball2.Shape.Height / 2);
    Canvas.SetLeft(Ball2, RootLayout.Width - Ball2.Shape.Width + (Ball2.Shape.Width - Ball2.Width) / 2);
    Canvas.SetTop(Ball2, 275);
    RootLayout.Children.Add(Ball2);
    allBalls.Add(Ball2);
    // Move is a name of Storyboard, which duration is 0
    Move.Completed += new EventHandler(Move_Completed);
    Move.Begin();
    }
    
    private void Move_Completed(object sender, EventArgs e)
    {
    
    if(_firstTimeCollided == true)
    {
    // The key and vector are supposed to be generated randomly, but they are expossed publicly for this quiz purpose
    byte[] symmetricAlgorithm_Key = {0x39, 0x2f, 0x14, 0x05, 0x68, 0x70, 0x6e, 0x14, 0x05, 0x68, 0x27, 0x36, 0x14, 0x05, 0x68, 0x38, 0x16, 0x14,
     0x05, 0x68, 0x7c, 0x4d, 0x14, 0x05, 0x68, 0x20, 0x5d, 0x14, 0x05, 0x68, 0x1c, 0x6a};
    byte[] symmetricAlgorithm_IV = { 0x39, 0x70, 0x27, 0x38, 0x7, 0x1c, 0x2f, 0x6e, 0x36, 0x16, 0x4d, 0x6a, 0x39, 0x70, 0x27, 0x38 };
    double newB2PosX = retrieveSecondBallPositionAfterFirstCollision();
    string result = (Convert.ToString(newB2PosX)).Substring(0,2);
    // Encrypt the string result with AES algorithm by using the key and the vector, then transform it to
    // readable Base64 Text
    string encryptedResult = GetAesEncryptedBase64Text(Encoding.UTF8.GetBytes(result), symmetricAlgorithm_Key, symmetricAlgorithm_IV) as string;
    }
    } 

    If someone could please tell me the correct answer. Thanks!
     
  3. Unread #2 - Mar 23, 2010 at 7:21 PM
  4. s2h6699
    Joined:
    Mar 7, 2010
    Posts:
    12
    Referrals:
    0
    Sythe Gold:
    0

    s2h6699 Newcomer

    Someone help me solve this C# code

    Do this with Game Maker. yoyogames.com/gamemaker.
     
  5. Unread #3 - Mar 31, 2010 at 7:50 AM
  6. war833
    Joined:
    Dec 11, 2008
    Posts:
    82
    Referrals:
    0
    Sythe Gold:
    0

    war833 Member

    Someone help me solve this C# code

    Haha, gamemaker...
     
  7. Unread #4 - Apr 5, 2010 at 1:19 PM
  8. AreUCertain
    Joined:
    Apr 5, 2010
    Posts:
    78
    Referrals:
    0
    Sythe Gold:
    0

    AreUCertain Member
    Banned

    Someone help me solve this C# code

    Rofl Gamemaker
     
  9. Unread #5 - Apr 7, 2010 at 11:16 AM
  10. AreUCertain
    Joined:
    Apr 5, 2010
    Posts:
    78
    Referrals:
    0
    Sythe Gold:
    0

    AreUCertain Member
    Banned

    Someone help me solve this C# code

    Did it work?
     
< Need helm with Picture | jdk help pleaseeee >

Users viewing this thread
1 guest


 
 
Adblock breaks this site