Ad
  • Custom User Avatar

    Yes, now it works for me too.

  • Custom User Avatar

    Tickets, please!

    Can you solve the best route to travel, when you have some half-price coupons in your pocket?
  • Custom User Avatar

    Why does the test say for example for n = 2903225426

    Expected: 0, instead got: 60453792

    When clearly 60453792 should be the correct solution, even Wolfram Alpha confirms this.

    PS. And it's the JS version I'm trying, (if there are others :D)

  • Custom User Avatar

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

  • Custom User Avatar

    I mean the case when we make a bond but it is invalid and will throw an Error. I was still making X bond to Y but then the execution would fail and throw an error (because I was testing the valence-ok:ness separately, not testing both first and only then making the bonds if ok, as it should be done). I guess the fixed tests doesn't include a test for this situation, at least I passed them with my then faulty Atom.connectTo -method.

  • Custom User Avatar

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

  • Custom User Avatar

    Very good kata! A lot of work, but so rewarding when you get it right. This also thought me about JS classes (I've come accross them but never looked at them more deeply, I just always used functions and prototypes. But these getters and setters are awesome, although it might feel strange at first when you access the variable just like it were a normal paramater, btw is this how for example the canvas drawing context works: when you try to set for example context.fillStyle = "something", it is set to black?) Well I digress.

    One possible suggestion I would make is to test the following: If we make a bond between two elements X and Y, and it is invalid, we set neither X to have Y as bondee nor Y X. I had this bug, where I would let the first happen even if the second would fail. Was only caught in the random tests and it was kind of a hassle to hunt down. Of course is seems obvious now :D.

  • Custom User Avatar

    Dang I struggled with the final test since I didn't use enough ()'s around %t's.
    Yippee, my second 1kyu solved! Very nice kata all in all!

  • Custom User Avatar
  • Custom User Avatar

    Nice Kata. Just a minor detail: In the description it says that a and b are even but the random tests also give odd numbers.