Ad
  • Custom User Avatar

    I would ask you to please mind your language on the site. Also constructive feedback goes a long way further than just insults.

  • Custom User Avatar

    Manual notification ^^

  • Custom User Avatar

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

  • Custom User Avatar
  • Custom User Avatar

    I don't think it is resolved, I am now getting many results like this:

    4394760810501401835469614985864712016711067361490760 should equal 4394760810501401835469614985000000000000000000000000
    

    You probably need to set Decimal.getcontext().prec to be much higher.

  • Custom User Avatar

    I cannot see your comment since I cannot solve the kata. You could come to the Discord (see link on the left menu) and we can discuss there. Otherwise if you want a reference you can click "view solution" under my comment to see what I think should be a correct solution.

  • Custom User Avatar

    I suspect you might have precision issues in your reference solution. For example with inputs: up=2, goal=2020450000000000000000, I calculate that we should be upgrading 126063 times, which should result in total clicks of 10684790872762699, but your tests expect 1 less at 10684790872762698.

    As the inputs get larger, the discrepency grows too.

  • Custom User Avatar

    Very hard 3kyu (at least in Agda) but very nice!

  • Custom User Avatar

    It was not actually a problem with the reference solution (since no reference solution is used) but I found and fixed a bug where randomly generated nodes were not guaranteed to be unique, which may have been the problem.

  • Custom User Avatar
  • Custom User Avatar

    Haskell (maybe Purescript too?) has random tests but they are very weak, at best. But issues with existing languages should not impact the quality of new translations.

  • Custom User Avatar

    I've made a fork implementing random tests. I think they should be reasonably balanced. Performance requirements could potentially be scaled up further. If the tests work alright then they could be a basis for random tests in other langs.

  • Custom User Avatar

    Python Fork

    • Switches to list of tuples for adjacency list
    • Adds random tests
  • Custom User Avatar

    While its now an adjacency list, the tests never actually produce a case where multiple edges leading from a node matter (ie. simply directly casting the input to a dict still works).

    Now looking at the tests, I see there aren't even random tests? I think this translation should not have been approved.

  • Custom User Avatar

    I am not sure how the other translations handle this, but the input format seems fundamentally flawed. With inputs as dicts, any node can lead to at most one other node, despite the description and even sample tests trying to give the impression that multiple paths could exist.

    For example this is tested in the sample tests: {'a':'b', 'b':'c', 'c':'a', 'c':'d', 'e':'a'}, however of course when this is parsed it resolves to just {'a': 'b', 'b': 'c', 'c': 'd', 'e': 'a'}, the 'c':'a' is lost.

    Edit: It looks like other translations use adjacency lists. Accordingly, the python translation should use a list of tuples instead of a dict.

  • Loading more items...