Ad
  • Custom User Avatar

    As you pointed out the condition is that you need to be on an adjacent cell AND one of the three conditions must be fulfilled. Attacking the opponent is not part of any of these conditions.
    If I am for example 2 cells away from an enemy and move towards him, I would be on an adjacent cell but since none of the three conditions is true I do not take damage from the enemy. This is what is implemented in the tests.
    But suddenly when I attack the enemy, if I do not kill him, he is allowed to attack me despite the fact that this is not what the description of the kata says.

    Also the condition "If you move away from them" is disturbing because this condition should never be true since the moment you move away from the enemy, you are not on an adjacent cell anymore.

  • Custom User Avatar

    The problem states the following:

    However, an enemy can attack you (whatever your orientation is), as long as you are on an adjacent cell to the enemy (vertically or horizontally, not diagonally) and if one of those conditions is fullfilled:

    • If you turn your character during the turn.
    • If you move away from them (D&D's opportunity attack :D).
    • If you use a potion. You will still recover your life points, but then you will be attacked.

    But the enemies can also attack you if you attacked this round which is not stated above, the statement should be updated to reflect that.

  • Custom User Avatar

    The tests should be changed and/or lessened, or the recursion tag should be removed from the question.
    I timed out the first time I tried a recursive solution in python and the second time I got an error because I exceeded the maximum recursion depth (the money was over 5000 and there was a coin with value 1).