Ad
  • Default User Avatar

    Oh my God. what kind of Bitboards !!!!!!!!!!!

  • Default User Avatar
  • Default User Avatar
  • Custom User Avatar

    I'd approve but for "Failed to approve: translation must be pending over a week or the kata author must be inactive for the past month".

    I still can't prove the random generator correct, and the reference solution is not independent from the random generator ( if the latter generates ambiguous data, the former will happily intercalate "," . map show it ), but I'd trust you it works. I'm sorry I can't override the waiting period.

  • Default User Avatar

    This kata is so simple that it's a bit of a struggle coming up with a different solution lol

    Anyways, reference solution added to the tests in an edit. I'm gonna leave the generator as-is instead of relaxing the checks.

  • Custom User Avatar

    OK, that TLDR is already commented in.

    There's still a lot of logic in the generator, and the reference solution still relies on the generator not generating cases with different possible solutions.

    Again, I trust you that it works, but running a gazillion tests against one example solution only proves that this particular combination does not have any problems; any bugs may cancel out. I would still really like to see a reference solution different from the example solution and independent of the random generator, because the random generator is too involved to prove right by reading the code ( at least without spending hours ). Right now, I'd just be taking your word for it. ( If I'm not explaining my problem well enough, or using concepts obvious to me but not you, I can try to clarify further; if so, please do ask. )

    Another possibility is having two separate example solutions; that would validate the random generator independently and massively decrease the chances of cancelling bugs in solution and random generator. ( The second solution can be in testing with some code to test either the user solution or the reference one, or it can be in the example solution and commented out so it can be commented in. )

  • Custom User Avatar

    Nice, and much appreciated!

    If you can write a TLDR here, would it be reasonable to add that as a comment on the source code? Testing code will eventually have to be maintained by other people ( or even just future you, who might appreciate it just as much :), so code as readable and maintainable as possible really is a good thing for kata internals.

    Other than that, it looks much better, and I'm do a review for approval now. Gimme a sec ..

  • Default User Avatar

    Sorry about that, seems like I got into the habit of making write-only code.

    I've added a few more comments and re-wrote parts of the generator so that it should be clearer how it works. TLDR: it remembers up to the last two numbers generated, so that it wont generate the same number or any intervals that can be merged. The test generator runs fine up to withMaxSuccesses 12_000_000 on my end, so I'm fairly confident it works.

  • Custom User Avatar

    Could you write more readable code? I'm wiilling to review, and I won't force my own style of writing Haskell ( cq. CW testing code in Haskell ) on you, but your code is a bit much for me. ( Also, I'm lazy. )

    Try to use do-notation instead of >>= \ arg ->, use some more line breaks, name some intermediate variables, but most of all, prove that the random generator works. I trust you that it works, but I am absolutely incapable of proving it for myself by reading the code. Using a reference solution ( esp. in this case, a different one than the example solution! ) would inspire more confidence than intercalate "," (map show xs) - which completely relies on the random generator not generating cases with a different possible solution.

  • Custom User Avatar
  • Custom User Avatar
  • Custom User Avatar

    At this point I can just port normal tests here (except for big ones)

  • Custom User Avatar

    Hi,

    In python at least: the unique sample test is totally useless... => needs more than that one.

    Cheers

  • Custom User Avatar

    There might be! Mayhap if someone will make one (or when I'll come up with a solution that fast (I might have some ideas)).

  • Custom User Avatar
  • Loading more items...