Ad
  • Default User Avatar

    Thanks for your translation! Very well followed the original... Nice job.

  • Default User Avatar

    Thanks... Recognizable! I also had to change my direction several times until I could solve.

  • Default User Avatar

    @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!

  • Default User Avatar

    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.

  • Default User Avatar

    The CompilerTest class does not have a package specified. The my.project package however is used for all of the classes that the test cases try to compile. So for example you might get a call like

    DynamicCompiler.compileAndLoad("my.project.Something", "package my.project; public class Something {}");
    

    Perhaps that is related to the problem you are experincing? Or perhaps there is some issue with the CodeWars website because my reference solution works without those errors.