Ad
  • Custom User Avatar

    Thanks!

    (Although I didn't seem to get any points for it. Do they go to the original translator?)

  • Custom User Avatar

    the expectedSolution method should be private

    Done.

    the building of the random list of coins is a bit weird (why not directly an array?)

    Done. Much simpler.

  • Custom User Avatar

    I think the java code block is missing the closing backticks? (maybe not, it's not clear by looking at the diffs)

    Not sure exactly what you mean here.

    Why the instane if the method is static...? => remove the instance completely?

    That was in the original translation that I forked. I have removed it.

    the solution setup is not aligned with the current solution (no static method).

    Fixed. Also added final to both parameters.

    could we use a loop to write only once the code for assertions?

    Done

  • Custom User Avatar

    added. apologies for the delay. :P

  • Custom User Avatar

    And finally I'm done!!! Found a couple of bugs in solution logic (lack of extra loop).

    The clue was extreme logging/printing when debugging move by move and even shot by shot!

  • Custom User Avatar

    But still of by one sometimes in the random tests... :/

    It's seems I bumped into the same issue. I pass all the test except 2-3 random tests when the result is different by 1.
    Two different solutions. But probably I implement the same bug twice. BTW, with the map you posted above. I think I don't understand the shooting timing properly or... I don't know(. And can't find the clue in the instructions and comments.
    Could you recall the kata and give me some hint? Though 7 years have passed:(((

  • Custom User Avatar

    edit: I don't fill like I "solved" the task, there...

    Yeah not really. I was not bothered fixing it after dfhwze solved the challenge this way, but now there is two of you so maybe I need to prevent this way of accidentally solving it.

  • Custom User Avatar

    No, this is actually an unintended typo :) Not the worst one you'd see in real JIRA tickets :)

    EDIT: I fixed the typo.

  • Custom User Avatar

    I've had similar bugs IRL. It's good to be aware of such issues, nice kata.

  • Custom User Avatar

    Take a look at exeption messages:

    Expected: No Exception to be thrown
      But was:  <XCom.Weaponry.StunGunTest+ShockedToDeathException: Test subject dies due to exceeded shock level
    

    This means that your gun sent an impulse with a voltage higher than can be tolerated by the target.

    Test Failed
      Expected: No Exception to be thrown
      But was:  <XCom.Weaponry.StunGunTest+MalfunctionException: Voltage increase detected
    

    This means that the voltage between following impulses inceased instead of dropping.

    Generally the advice would be like with debugging a normal kata: figure out what inputs make your solution fail, recreate them in sample tests, and adjust the oscilloscope (for example by adding prints of what it captures) to check for some unexpected behavior of the voltage modulator.

  • Custom User Avatar

    There are example implementations of IStunee in the sample tests: one is an oscilloscope/voltage meter, and one is a dummy sectoid. The contract is trivial, it reacts to single impulses emmitted by the gun. Are the example implementations in the sample tests not helpful or explanatory enough? You can modify them at will, an use them to monitor what your gun sends to its targets.

  • Custom User Avatar

    6 years past still have problems in discription or tests (

  • Custom User Avatar

    Your task is to calculate the expected value of a randomly selected element from this matrix that is the average value that you would anticipate following a large number of trials where each element has an equal likelihood of being selected.

  • Custom User Avatar

    I hope I made the wording clearer

  • Custom User Avatar

    done

  • Loading more items...