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.
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.
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'):
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.
The quote from the description you provided literally says that:
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..
Yes, you will also take damage in this situation.
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.
I didn't notice any bugs, the only thing is that I didn't use the "katas" table at all, but everyone has their own approach, I think it's okay.
p.s. @dfhwze, I am amazed at your productivity in creating kata, keep it up!
Yeah, it works. Thank you, you are my hero:)
⬇
⬇
Thank you.
This comment is hidden because it contains spoiler information about the solution
Long story short, it's a problem with the ruby test library from codewars (the
run_sql
function incorrectly truncates the literal string in some cases).I can take a look at it if you post your code. :)
Hi. I have written an algorithm. Tested locally on the last fixed test, the result is the same. But when I try to test on codewars I get an error: "PG::SyntaxError: ERROR: unterminated dollar-quoted string at or near "$$". And I can't understand what the problem is, the same code works for me both in PyCharm and PGAdmin. Accordingly, I can't check the code's operability and efficiency on other tests. Can someone help me please? I can publish the code under a spoiler.
no pain, no gain
Yes. Ok, that's exactly what I wanted to avoid :). Okay, well, life is pain. Thank you.
You could use a select statement to iterate all tables and build insert statements from that using dynamic sql. I can't think of an easier way.
Loading more items...