Ad
  • Default User Avatar

    Hi,

    Considering the rank of the kata, you should be able to get all the calls one way or another, but since it seems there is a problem and you're using python, define this at the beginning of your code: TRACE_CALLS = True. You'll have the complete trace so we'll be able to check what is incorrect. Come again with the assertion message and the complete trace of the calls, please.

    Cheers

  • Default User Avatar

    Well, no news, closing. Feel free to continue the discussion if needed, of course.

  • Default User Avatar

    I checked by hand only: Are you sure you didn't misspelled something in your example? because I end up with the following:

    m = Molecule().brancher(5, 4, 5).mutate((3, 1, 'C'), (2, 3, 'N'), (5, 3, 'S')).brancher(4, 2, 7).bounder((5, 3, 4, 4), (4, 3, 2, 5)).mutate((3, 1, 'O'),).add_chaining(2, 5, 'B', 'Br').brancher(1, 5).add((2, 1, 'Br'),)
    
    
                     |-------------|
                     |             |
           1     6   | 10     15   | 19       21     30     31
    (Br)36-2     7   | 11(N)  16   |-20-      22            32
           3(O)  8   | 12     17       |      23            33
           4     9   |-13     18       28(B)  24            34
           5           14(S)  |        |      25            35
                        |-----|        29(Br) 26            
                                              27            
    

    So C5 isn't linked to S14 as you wrote above (-> Atom(C.5: S14, C4)).

    About this: Seems that my code has Atom(C.15: C14,C16,C16) in a closed molecule which should be Atom(C.15: C14,C16,C16,H) it's hard to say without the steps. A lot could happen at different steps before explaining the problem in different ways (atom mutated to H so at this step you have an unlocked molecule? Or is the molecule locked? ...?).

  • Default User Avatar

    Hi,

    Thx for letting me know. I'll look into the whole thing later today.

    About the exceptions, did you see the last foot note? => About the required exceptions classes, you can implement subclasses if you want, but their names will have to contain the name of the one originally expected.

    And I'm not sure what you mean by an unmutated exception. Are you talking about subclasses, actually? But you are true about one point: this is suboptimal. If I had to do that again, I'd provide the exceptions so that I could always use the same manner to check for them. The thing is I didn't want to relay on the exceptions of the user (it could have been a way to cheat, even if not on purpose), and since I couldn't predict what would be the exceptions in the random tests, I needed my own set of them. That caused the mess.

    I'll keep you posted.

  • Custom User Avatar

    Thanks this Kata was published before Codewars offered Python 3 and it just made it out of Beta. I have updated using range instead of xrange. This issue should be resolved.