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.
I've added a new java translation for review.
This comment is hidden because it contains spoiler information about the solution
Fun and challenging kata! can't wait to try the 6x6
I'd suggest obstacle detection should only occur when closing.
If the door is opening it wouldn't matter; in this case if opening and an obstacle occurs it'd start closing and squish a pet. - This sounds like the original problem the company probably wants to solve. ie When an obstacle is detected the door should begin opening if closing. If already opening and an obstacle is detected continue opening.
An additional intersting additonal would be a double press of the button would reverse direction. And further to that a double press after obstacle would ignore any further obstacles until closed.
Yeah seems to be something with CodeWars. If I put a package on the unit tests it gets 'stuck' in that package even after removing it.
For some reason for submitting, if the solution is not in a package it returns;
And when in the package it returns
Giving an empty class also has the submit report the /my/project path for CompilerTest, seems it's stuck running the test cases out of a different directory.
Edit: It seems the package stickign only occurs on this kata for me. Tried on another with putting the test cases into a package and all was fine after removing it.
There was another comment on the forum about this kata and someone else having the same issue.
Looks like the solution test cases are setup with a package name which doesn't allow submiting of the solution;
/my/project/CompilerTest.java:14: error: cannot find symbol
Class testClass = DynamicCompiler.compileAndLoad(name,
^
symbol: variable DynamicCompiler
location: class CompilerTest
/my/project/CompilerTest.java:31: error: cannot find symbol
This seems to be happening again, getting nothing but timeouts
?
I realized after submitting that this would actually fail a test case where either a substract/add/multiply/divide operation is done with a fraction which includes a whole value (ie 5/4 + 1/4) or if it checks the toDecimal of a fraction like 3/2.
assertEquals("Proper addition was expected", "1 1/2", new Fraction(5, 4).add(new Fraction(1, 4)).toString());
assertEquals("Proper fraction to decimal value conversion expected", 1.5, new Fraction (3,2).toDecimal(), 0);
From what I'm encountered some exceptions from Java do not cause the test cases to fail, nor are the cases shown as succeeded - but the whole kata shows as succeeded which can be misleading and allow for a final solution to be posted which doesn't pass some cases.
ie, http://www.codewars.com/kata/54f7d97f8c2d9e9a110004ff
In that scenario, if one test case succeeds and others fail with an ArrayIndexOutOfBoundsException those with the exception do not cause the whole kata to show as failure.