Ad
  • Default User Avatar

    Boring is the best possible outcome.

  • Default User Avatar

    God is the creator of Humans, and has no inner Human class, because no human is a god. Try it with three separate classes, and it should work fine. You just need to know the minimum about classes and inheritance to complete the task.

  • Custom User Avatar

    Yes. This could have been explained better.

  • Default User Avatar

    Haha that was my thought to :D

  • Custom User Avatar

    It took me a while to figure that this is java 8. Nice for the ones who work with. But for the rest...

  • Default User Avatar
  • Custom User Avatar

    There's no requirement in Java for classes to be in seperate files. It's obviously best practice in the real world but for simple academic exercises such as these it's perfectly acceptable to have all the classes in one file.

  • Default User Avatar
  • Custom User Avatar

    As far as I know you can define multiple classes in one file as long as only one of them is public (although it's very messy).

  • Custom User Avatar

    This kata needs serious work.

    • I fail to see how the classes can be defined, as there's no way to place them in separate .java files.
    • The test cases expect types Human, Man, Woman. So inner classes won't do the trick (God.Man != Man)
    • If there is a solution, it's far from trivial and more of a gimmick. It's certainly not idiomatic Java, which is what I'd expect at 8 kyu.
    • Broken English, especially in test cases. I'm not a native speaker myself, but it's rather painful to see things like "Adam are a man" and 'Eva' instead of Eve.

    Java

  • Custom User Avatar

    Now this is a high quality, well-written kata! It was fun to solve and the method scaffolding is appreciated.

    Not having any previous genetic algorithm experience, one suggestion I have is to clarify the procedure of forming a new population.
    At first it was unclear to me where the selected chromosomes had to go. Was the new population the old one with the two chromosomes replaced? Only after reading an article on the subject did I figure out that growing a new population is a separate concept from the evolution cycles. (Or at least I think it is, since my solution was accepted.)

  • Custom User Avatar

    Something fishy is going on with the test cases on submit:

    finalSearchTestRareCases(WildsTest)
    expected:<0> but was:<-1>
    nonCharTest(WildsTest)
    expected:<0> but was:<-1>
    

    So I made a single change in my code, I now return 0 on non-match to see what it reports:

    finalSearchTestRareCases(WildsTest)
    expected:<-1> but was:<0>
    nonCharTest(WildsTest)
    expected:<11> but was:<0>
    

    What is going on here?!
    Are the test strings pseudo randomly generated with the hash of my code as the seed?