The description is really unclear. I read the description many times and still has no idea what you meant by
estimate of the distance between the officer and a point on the road (specifically, the point at which the car will be travelling perpendicular to the estimated distance)
Or what that point is. You really need to put up a diagram or something.
// Test that negative input for distance in readings array throws error
Test.expectError("One of the distances in readings array was negative", function() {
speedError(6,3,[[-50,0],[30,1]]);
});
// Test that a 0 input for distance in readings array throws error
Test.expectError("One of the distances in readings array was negative", function() {
speedError(6,3,[[0,0],[-30,1]]);
});
The second test does not actually test what is intended to be tested because it's shadowed by the condition in the first test (there's a -30 here).
In JS solution :
Test case does not meet description : speedError(8,2,[[5,1.82 ],[5,0.48]])
Value 8 is bigger then ~5.
Making radar position not perpendicular to road.
Tested some aprooved solutions and this breaks pythagorean calculations.
Math.sqrt(55 - 88) => NaN.
I liked this kata but need some improvements.
Testing functions should not be put in Preloaded. They belong in the actual tests.
Node 8+ should be enabled.
The description is really unclear. I read the description many times and still has no idea what you meant by
Or what that point is. You really need to put up a diagram or something.
Sample test:
The second test does not actually test what is intended to be tested because it's shadowed by the condition in the first test (there's a
-30
here).Hi danmarcus. Check this test:
Is it possible that the reading of the distance from the radar gun to the car be less than the cop from the road?