Ad
  • Default User Avatar

    Sorry, I've been busy and haven't had the chance to get back to this.

    I'm basically saying that my code works fine everywhere except two random cases in your random tester. One is where somehow some atoms in the molecule are out of sync with the rest of the atoms, printing out that they're bonded to atoms incorrectly. The other is where an molecule appears to have been closed but one carbon is missing a hydrogen.

    ['Atom(C.1: C2,C2,C21,B14)', 'Atom(C.2: C1,C1,Br34,S3)', 'Atom(S.3: C2,C4)', 'Atom(C.4: S3,H,H,H)', 'Atom(C.5: C6,H,H,H)', 'Atom(C.6: C5,C7,H,H)', 'Atom(C.7: C6,C8,H,H)', 'Atom(C.8: C7,C9,H,H)', 'Atom(C.9: C8,C10,S15,H)', 'Atom(C.10: C9,C11,H,H)', 'Atom(C.11: C10,C12,H,H)', 'Atom(C.12: C11,H,H,H)', 'Atom(Br.13: H)', 'Atom(B.14: C1,H,H)', 'Atom(S.15: C9,Mg16)', 'Atom(Mg.16: O17,S15)', 'Atom(O.17: Mg16,H)', 'Atom(C.18: C19,B52,H,H)', 'Atom(C.19: C18,C20,C26,H)', 'Atom(C.20: C19,C21,H,H)', 'Atom(C.21: C1,C20,Mg31,H)', 'Atom(C.22: C23,H,H,H)', 'Atom(C.23: C22,C24,H,H)', 'Atom(C.24: C23,C25,B30,H)', 'Atom(C.25: C24,C26,H,H)', 'Atom(C.26: C19,C25,C27,C49)', 'Atom(C.27: C26,C28,H,H)', 'Atom(C.28: C27,C29,H,H)', 'Atom(C.29: C28,H,H,H)', 'Atom(B.30: C24,H,H)', 'Atom(Mg.31: C21,B32)', 'Atom(B.32: C33,Mg31,H)', 'Atom(C.33: B32,H,H,H)', 'Atom(Br.34: C2)', 'Atom(C.35: C36,H,H,H)', 'Atom(C.36: C35,C37,H,H)', 'Atom(C.37: C36,C38,H,H)', 'Atom(C.38: C37,C39,H,H)', 'Atom(C.39: C38,C40,H,H)', 'Atom(C.40: C39,C41,H,H)', 'Atom(C.41: C40,C42,H,H)', 'Atom(C.42: C41,H,H,H)', 'Atom(C.43: C44,H,H,H)', 'Atom(C.44: C43,C45,H,H)', 'Atom(C.45: C44,C46,P53,H)', 'Atom(C.46: C45,C47,P51,H)', 'Atom(C.47: C46,C48,H,H)', 'Atom(C.48: C47,H,H,H)', 'Atom(C.49: C26,Cl50,H,H)', 'Atom(Cl.50: C49)', 'Atom(P.51: C46,H,H)', 'Atom(B.52: C18,H,H)', 'Atom(P.53: C45,H,H)', 'Atom(C.54: C55,H,H)', 'Atom(C.55: C54,H,H,H)'] should equal ['Atom(C.1: C2,C2,C21,B14)', 'Atom(C.2: C1,C1,Br34,S3)', 'Atom(S.3: C2,C4)', 'Atom(C.4: S3,H,H,H)', 'Atom(C.5: C6,H,H,H)', 'Atom(C.6: C5,C7,H,H)', 'Atom(C.7: C6,C8,H,H)', 'Atom(C.8: C7,C9,H,H)', 'Atom(C.9: C8,C10,S15,H)', 'Atom(C.10: C9,C11,H,H)', 'Atom(C.11: C10,C12,H,H)', 'Atom(C.12: C11,H,H,H)', 'Atom(Br.13: H)', 'Atom(B.14: C1,H,H)', 'Atom(S.15: C9,Mg16)', 'Atom(Mg.16: O17,S15)', 'Atom(O.17: Mg16,H)', 'Atom(C.18: C19,B52,H,H)', 'Atom(C.19: C18,C20,C26,H)', 'Atom(C.20: C19,C21,H,H)', 'Atom(C.21: C1,C20,Mg31,H)', 'Atom(C.22: C23,H,H,H)', 'Atom(C.23: C22,C24,H,H)', 'Atom(C.24: C23,C25,B30,H)', 'Atom(C.25: C24,C26,H,H)', 'Atom(C.26: C19,C25,C27,C49)', 'Atom(C.27: C26,C28,H,H)', 'Atom(C.28: C27,C29,H,H)', 'Atom(C.29: C28,H,H,H)', 'Atom(B.30: C24,H,H)', 'Atom(Mg.31: C21,B32)', 'Atom(B.32: C33,Mg31,H)', 'Atom(C.33: B32,H,H,H)', 'Atom(Br.34: C2)', 'Atom(C.35: C36,H,H,H)', 'Atom(C.36: C35,C37,H,H)', 'Atom(C.37: C36,C38,H,H)', 'Atom(C.38: C37,C39,H,H)', 'Atom(C.39: C38,C40,H,H)', 'Atom(C.40: C39,C41,H,H)', 'Atom(C.41: C40,C42,H,H)', 'Atom(C.42: C41,H,H,H)', 'Atom(C.43: C44,H,H,H)', 'Atom(C.44: C43,C45,H,H)', 'Atom(C.45: C44,C46,P53,H)', 'Atom(C.46: C45,C47,P51,H)', 'Atom(C.47: C46,C48,H,H)', 'Atom(C.48: C47,H,H,H)', 'Atom(C.49: C26,Cl50,H,H)', 'Atom(Cl.50: C49)', 'Atom(P.51: C46,H,H)', 'Atom(B.52: C18,H,H)', 'Atom(P.53: C45,H,H)', 'Atom(C.54: C55,H,H,H)', 'Atom(C.55: C54,H,H,H)']

    From my perspective these issues should've come up in the normal tests, so since they didn't either (a) the random tester is doing something really weird, or (b) the normal set of tests needs more tests.

    It's really really hard for me to get the exact functions that were run b/c the random tester doesn't seem to print to std out? I can only get info out of std error, but need to know the error first. Bit frustrating, need to know the bug so I can fix it.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    a few opinions:

    1. it's nice that the grid is subscribable, but i think it'd be cleaner to make each node callable by position e.g. grid.node(x,y) = True
    2. position property should return a tuple, not have a property within itself called x; why is there a class within a class?
    3. can you please work on getting this compatible with py3??? which would be way more efficient for this kind of problem
  • Default User Avatar

    This kata should have some time complexity optimization in it. As it stands right now it's way too simple.

  • Default User Avatar

    I also have this same issue.

  • Default User Avatar

    This should be straightforward with python3's standard statistics module, but the grader seems to use xrange which doesn't exist in python3.

  • Default User Avatar

    Some sort of strange problem returning an out of range for Enumerable.Repeat with the count parameter in the example. Doubtful that the exaple is larger than the max range of Repeat()???