Ad
  • Custom User Avatar

    The default test case has this line:

    Assert.AreEqual("Team 1 wins!", Kata.tug_o_war(new int[2,5] { {1,2,3,4,6}, {5,4,3,2,1} } ));

    which is invalid. the line needs to be

    Assert.AreEqual("Team 1 wins!", Kata.tug_o_war(new int[2,5] { new int[]{1,2,3,4,6}, new int[]{5,4,3,2,1} } ));

    Marked as major because the tests fail to run due to this even if the users code is valid.

  • Custom User Avatar

    The instructions could use a bit of work on specifying the anchor.

  • Custom User Avatar

    Thanks I got it, at the end I just had some silly mistakes.

  • Custom User Avatar

    Think the bug lies in your .equals method.

    What should you compare ?

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    I forgot to move those statements, but I still get an error

    Testing arithmetic
    Addition
    error
    Subtraction
    error
    Dot Product
    Test Passed: Value == 26
    Test Passed: Value == 26
    Expected error was thrown: function (){
    console.log('error');
    }
    Test Passed
    Norms
    Test Passed
    Test Passed
    Test Passed
    Auxiliary function
    Equality
    Test Passed
    Test Passed
    Value is not what was expected
    Test Passed
    Test Passed
    Strings
    ReferenceError: Invalid left-hand side in assignment at toString at Object.Test.it at Object.Test.describe at Object.

  • Custom User Avatar
    • It seems your .equals method returns true when 2 vectors .components are of different lengthes.

      Are you sure this is the expected behavior ? ( Isn't (1, 2) equals (1, 2) ? )

    • In your .add, .subtract & .dot methods you test first if the vectors are equals.

      That means you can't add (or sub, or dot) (1, 2) & (3, 4)...

    Hope it helps.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    I postef the code

  • Custom User Avatar

    I know that I could still be wrong but I just dont see it.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Can you post your solution so I can see about it?

  • Custom User Avatar

    I have the correct function/output but the tester function marks it as incorrect