Ad
  • Custom User Avatar

    Fixed C and C++ test code. Sorry for the oversight.

  • Custom User Avatar

    Cool kata.
    Same occurs for C - took me some time before I realized source of not correct values.
    Would be cool to add odd numbers of a and b to basic tests for next who will be trying to pass this kata.

  • Custom User Avatar
  • Custom User Avatar

    Should be fixed, please check ;-)

    (The reference solution used to calculate carmichael(2) = 0, which I've fixed)

  • Custom User Avatar
  • Custom User Avatar

    aaaaah.... Good point. I will add a test for that, thx. :)

  • Custom User Avatar

    Mmmmh, that's weird, because I have some tests that should have seen that kind of problems. Maybe there are several intricated things, in your faulty code?

    Do you remember what kind of command was exactly involved? add? bounder? add_chaining?

    I have currently things like this:

    #Invalid \"bounder\" command resulting in butyne skeleton with valid operations:
    Molecule().brancher(4).bounder((3,1,2,1), (3,1,2,1), (3,1,2,1))
    exp = ['Atom(C.1: C2)', 'Atom(C.2: C1,C3,C3,C3)', 'Atom(C.3: C2,C2,C2,C4)', 'Atom(C.4: C3)']
    

    Here, during the last bounding and from what I understand of what you said, it feels like your code should have failed because you'd have gotten something like:

    'Atom(C.1: C2)', 'Atom(C.2: C1,C3,C3,C3,C3)', 'Atom(C.3: C2,C2,C2,C4)', 'Atom(C.4: C3)'
    should equal
    'Atom(C.1: C2)', 'Atom(C.2: C1,C3,C3,C3)', 'Atom(C.3: C2,C2,C2,C4)', 'Atom(C.4: C3)'
    

    Obvisouly, that's not what happened to you, so I wonder what is the underlying "other" bug... :o

  • Custom User Avatar

    Hi,

    Glad you liked it. :)

    About your suggestion, I'm not sure I'm following, becasue, from what I currently understand, this should have been catch by the fixed tests: normally, if one atom is bonded to another, but not the opposite, the string representation should be unbalanced about those. Like Atom(C4: C2,Y4,H,H), ..., Atom(Y4,H,H) where Y4->C4 isn't present, for example. Unless your toString implementation isn't correct or you had that problem about an explicit bond with a H when you get the error. Would you still have the data about that test, by any chance? (commands/inputs and you actual output)

    cheers

  • Custom User Avatar

    Please tell me, what language you are using?