Ad
  • Custom User Avatar

    Let's go to Mars! ^^

  • Custom User Avatar

    That wasn't present. I added a subsection about the family at the beginning of the rules where I put that information.

  • Custom User Avatar

    Thanks for beta testing it again! (Almost a week.)

  • Custom User Avatar

    I don't think so. I usually pass the tests between 4 to 6 seconds. Sometimes, rarely, it takes 8 or 9 seconds. If you think that the tests are too unbalanced, I can shrink some of them.

  • Custom User Avatar

    I was, exactly five seconds ago, going to add a note about that. The direction of a path is not important. The path 1 → 2 → 3 is the same than the path 3 → 2 → 1. That's why I chose to show paths in different directions in the sample tests.

  • Custom User Avatar

    No, but each path can have a different common ancestor. I see your point, I will think of way to make it clearer.

    Edit: I changed the formula to

    \displaystyle\sum_{\substack{p \in P}} \frac{1}{2^{L(p)}} (1 + F_{c_p})
    

    Where $c_p$ is the common ancestor of a and b on the path p.

  • Custom User Avatar

    I accommodated the tests to the new definition: there's now one path between someone and themself.

  • Custom User Avatar
    • no : if I made the things right, the tests only generate family trees with cousin marriage between persons from the same generation
    • that's what I wanted to underline with : in this kata: a person has either both a mother and a father, or neither a father nor a mother
  • Custom User Avatar

    I changed the first sentence of the rules to An ancestor of a person is either themself or any direct ascendant of that person. I also removed the sentence about the common ancestor when going down from an ancestor to some of their descendant.

    When I was doing my research, I found that there are other things to take account of when computing the coancestry of two persons for some specific cases (for example when they are ancestor-descendant in one way and cousins in another way). The note is there to inform the user that the formula is not exact for some cases. Maybe I should rephrase it.

  • Custom User Avatar

    Approved, thanks for your work and your support.

  • Custom User Avatar

    Two errors in the sample and fixed tests that I edited:

    • second describe block, third it block, in the input: "ibrahim has three daughters..." should be "ibrahim has 3 daughters..."
    • third describe, first and second it, in the input: "laozi has two sisters..." should be "laozi has 2 sisters..."
  • Custom User Avatar

    That sounds good.

  • Custom User Avatar

    I adapted the code and added these two points after the definition of the expected structure in the Task subsection:

    • you are given a default structure implementing that specification
    • if your language allows to do it easily, you can define and use a custom one, provided that it is compatible with the given specification

    Then, in the Python code block: In Python, you can define a custom structure. The default one is the following dataclass Person:.

    If that's not easily doable in some language, the translator will just have to add, in the code block of its language, "You can't define your own structure in X. You are provided with the following one....".

  • Custom User Avatar

    I thought about asking to render a string when I was designing the kata and I thought that users like Voile wouldn't like an artificial step not related to the core task. Let's keep your first idea: defining a minimal contract and providing a default implementation. I will do that for Python later today, or tomorrow (I'm working on the cousin marriage kata right now).

  • Custom User Avatar

    I can do that later. There's a __str__ method tied to the Person class that is used by the tests to display the actual tree if any error occurs. I wanted it to be available for the user so that they can have a somewhat (only the subtree rooted at the node on which the method is called) useful representation of what they are doing.

    I plan to translate this kata to my other usual languages some day (not now). It will be easy to do it in JS, but how would you see it in Java or Common Lisp, for instance ?

  • Loading more items...