Ad
  • Default User Avatar

    You never define how the bag should be returned nor give an example.

  • Custom User Avatar

    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.
    Let me give you an example:

       E
       >
    actions: F
    

    In this example, you are on an adjacent square to an enemy. Your action is to take a step forward. The moment you attempt to move, you take damage, after which (if you are alive) you move one square forward. That is, you need to assess the situation around you before making a move, first registering the damage you take, then making a move. I hope this is useful and helps someone in the future.

  • Custom User Avatar

    Yes, I agree that the description could have been better. But regarding attacking and taking damage afterwards, it's in the description (block 'Attack mechanics and enemies'):

    Just remember that you attack and use objects before the enemies besides you attack. Here is an example where two enemies would attack you

    EEE                      EEE
     >E        =>             >
    EEE        action: A     EEE
    hp: 3                    hp: 1
    

    It's quite another matter of tests. For example, I just checked that this behavior is not implemented in my solution and it still passes all tests. I don't remember the reasons why I didn't implement it, as I solved this problem quite a long time ago. I only register the damage from "Demon Lord". Accordingly, there is no test for the case given in the description, or there are tests, but in moments when the defense of my character in such moments does not allow to receive damage.

  • Custom User Avatar

    I agree with your last statement. This was very confusing to me too. That, and the fact "moving away" isn't even specified in the description. You need to guess what that means. Luckely, a user mentioned what is means in some other comment. But the description is just lacking quality in that respect.

  • Custom User Avatar
  • 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 quote from the description you provided literally says that:

    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.

    Three conditions - additional options for when you can be attacked by enemies, besides the case when you are on the cell adjacent to the enemy.
    Accordingly, after you have attacked one enemy, all other enemies on neighboring squares (if the basic condition is met) attack you according to basic rule..

  • 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
    E     ->    E
    >            >
    

    Yes, you will also take damage in this situation.

  • Custom User Avatar

    After you have taken 5 steps forward and approached the enemy, the next step is to turn 180 degrees, this is where you get the first damage; the second damage you get on the next step when moving forward. That answers your original question.

  • Custom User Avatar

    Is this also considered "moving away"?

    E     ->    E
    >            >
    
  • Custom User Avatar

    I bet it's this

    If you move away from them

    Whatever moving away even means.

  • Custom User Avatar

    How does that enemy do 2 damage to me? It attacks me once during ">" and does (2 - 1) damage.

    Actions: FFFFF>F
    
    Before
    
    HP: 3 | Atk: 1 | Def: 1 | Bag: []
    SHM   |EX
    ###   ###
    CCK     C
     E       
    DEE     <
    
    
    After
    
    HP: 2 | Atk: 1 | Def: 1 | Bag: []
    SHM   |EX
    ###   ###
    CCK     C
     E       
    DEE >    
    
    
    Should be
    
    HP: 1 | Atk: 1 | Def: 1 | Bag: []
    SHM   |EX
    ###   ###
    CCK     C
     E       
    DEE >    
    
  • Custom User Avatar

    There will only be one demon lord per map

    No, at most one.

  • Custom User Avatar

    So there are hidden constraints other than these?

    • must be equal to the number of lines in the code)
    • and no spacing characters (spaces, tabs...)
  • Loading more items...