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.
imo this is really elegant
The first solution that actually takes into account that no constraints have been placed on the numbers in the description. =)
This comment is hidden because it contains spoiler information about the solution
Thanks for your translation! Very well followed the original... Nice job.
I've added a new java translation for review.
Thanks... Recognizable! I also had to change my direction several times until I could solve.
This comment is hidden because it contains spoiler information about the solution
Fun and challenging kata! can't wait to try the 6x6
@OzzyD Thanks Ozzy. I have actually modeled this problem after my own garage door :-), which can harm pets both ways. I will try to add the double-press improvement, but my intent is to keep the problem description as simple as possible. Cheers!
Thanks;-)! Probably time for holidays... :-) (after completing #4000;-))
Congrats !
; ) )
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.
You can also replace this lambda
by a method reference
Yeah I tried submitting my solution in 'Train' mode and had the same issue (no issue when validating in kata creation mode). I ended up setting a package for all of the classes (test classes and initial code template) which seems to have fixed the issue. Try setting the package
org.codewars.kata.dynamicjava
for your solution and custom tests and see if that fixes it.I changed all of the package names in the code to be compiled in the test cases to
org.codewars.kata.dynamicjava
as well but playing around a bit with the custom test cases in 'Train' mode no matter what I tried setting the package names to in the code to be compiled it didn't seem to cause any errors. I think the problem only occurs if the test class or solution class uses the default package and you try to load a class with a non-default package name. And this problem only seems to occur in 'Train' mode.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.
Loading more items...