Ad
  • Custom User Avatar

    This solution was briefly invalidated, but that was my mistake.

    Nice code!

  • Custom User Avatar

    It is private now. Thank you.

  • Custom User Avatar

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

  • Custom User Avatar

    Thank you, it is fixed

  • Custom User Avatar

    in the final sample test case, there is an extra space in between the 1 and the subtraction sign.

  • Custom User Avatar

    Thank you for the translation!

  • Custom User Avatar

    Python translation

    Nice kata by the way!

  • Custom User Avatar

    So for random test cases, you should definitely look at katas you've solved and see how they implemented random tests into their kata so you get a good idea and a good variety of implementations. You can't really "follow along" with a guide because creating random test cases varies from kata to kata.

    For starters, I'll answer your question that you asked in your reply. You need to create a private method of the solution inside of your test cases. So then when you call assertEquals(correct output, user's output), you can just call your private solution method in order to see if the user's solution was correct. Again, look at katas you've solved to get a better idea of this.

    For this kata in particular, I would recommend you make an array that keeps a pool of words it can randomly take from instead of just adding empty strings everywhere that isnt't a snark location (just makes it look nicer I suppose). Have some sort of "chance" (maybe like a 9/10 chance?) that there is a snark and insert it into a random location in your array. Then randomly assign integer values into the "Boojumeter" array. For this I would recommend to make it a pretty small bounds in order to ensure that there's a good chance of 0-14 being assigned (so it's not always a Boojum).

    I hope this steers you in the right direction, and I hope you continue to author more katas in the future!

  • Custom User Avatar
    • merge conflict (you need to fork this, copy the current description and paste it in the fork's description)
    • Java version is outdated, you need to set the fork's version to Java 18
  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    First, I added two new example test cases that should further illustrate the goal of the kata.

    Second, I made it more likely to create duplicates, for array sizes >= 50, the range of random inputs is now 1 - size/3. array sizes < 50 is now 1 - size/2. Hopefully this satisfies this issue.

    Thank you!

  • Custom User Avatar

    Hi,

    The inputs generation must be changed: currently, most of the balloons will have unique sizes which means that some incorrect algo could slip through the random tests rather easily. The range for the sizes should not exceed something like randSize/3, to get a "proper" number of duplicated sizes.

    Note: I didn't dig in the two fixed tests, but I storngly doubt they are enough.

    Cheers

  • Custom User Avatar

    I fixed the initial solution for Python, thank you for pointing that out! (if you click reset the change should show now)

  • Custom User Avatar

    sample tests: balloons and pops seem to be switched as arguments

  • Loading more items...