Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
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.
The instructions could use a bit of work on specifying the anchor.
Thanks I got it, at the end I just had some silly mistakes.
Think the bug lies in your
.equals
method.What should you compare ?
This comment is hidden because it contains spoiler information about the solution
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.
It seems your
.equals
method returnstrue
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.
This comment is hidden because it contains spoiler information about the solution
I postef the code
I know that I could still be wrong but I just dont see it.
This comment is hidden because it contains spoiler information about the solution
Can you post your solution so I can see about it?
I have the correct function/output but the tester function marks it as incorrect