Beta

Hydra Monster

Description
Loading description...
Fundamentals
Trees
Simulation
Strings
ASCII Art
  • Please sign in or sign up to leave a comment.
  • K01egA Avatar

    Nice challenging kata. People usually afraid of katas with long description. But this description covers all cases with examples. Small issue: there are unmatched brackets in last two examples in description. Suggest tag: ASCII Art.

  • Madjosz Avatar

    Please add a sample (and fixed) test case for "Prime hydra"

    [[[1], [2], [3], []], [1, 3],
     `#
      |
      x`]
    

    My current solution is failing this and it is only caught by some big random tests.

  • Madjosz Avatar

    In Type 2 regeneration examples in the description the root node is sometimes a body x and sometimes a head #. I have the feeling that these belong together and it should be consistent. Otherwise the question comes up where the head in the root spawns from.

    • dfhwze Avatar

      I don't really get what you're getting at. Is the description not consistent, or the problem? I feel the problem is consistent, in that when the root body gets cut, a single head spawns as root as a last resort hydra. Cutting that head kills the Hydra. Let me put it this way, whenever you cut a x, that part and all its descendant parts get cutt of and get replaced by a head #. The root body is no exception to this rule.

    • Madjosz Avatar

      It's the example in the description:

      • "Lets take the same example as in Type 1 ..." - x as root
      • "Its grandparent is the root node ..." - suddenly # as root

      Same goes for the next part where the ids are shown.
      You cannot have a head with child nodes I think.

    • dfhwze Avatar

      You are absolutely right. A head never spawns any additional body parts as descendants. This was a rendering mistake of me in the description. Fixed