Ad
  • Custom User Avatar

    I changed the Show instance in preloaded, let me know if that works better.

  • Custom User Avatar

    Approved. This looks great! Thanks for your work on this.

  • Custom User Avatar

    Had me stuck for a good bit! Very fun!

  • Custom User Avatar

    It's up to you what the specification should be, but the description needs to accurately explain why some functions are included and others aren't. Right now, it says that hypot isn't included because of its arbitrary positional arguments, but that's not the case.

  • Custom User Avatar

    Why exclude hypot but include lcm and gcd, both of which take an arbitrary number of arguments.

    More generally, what is the specification on which functions to skip?

  • Custom User Avatar

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

  • Custom User Avatar

    Seconding the suggestion to remove the starter code, but if you do keep it, you should avoid the hash variable name as it overrides the built-in function of the same name in python.

  • Custom User Avatar

    Cool kata! Some suggestions for the description, mostly based on what tripped me up:

    • I've always heard of gray codes as a category of encodings, so I was confused by "The Gray Code" and "The Even Gray Code" referring to specific encodings. Especially the reference to "The bit switched at each step is the one that yields the smallest value not yet represented" which is not what I'm familiar with as the most common gray code.
    • I'd clarify the "The bits changed at each step should yield the smallest value not yet represented." Specifically that "smallest" is referring to a standard binary encoding.
    • The use of index is unclear, as it refers to the value we want to encode. I suppose it makes sense if we think of the encoding as a list, but there's no reason to do so.
  • Custom User Avatar

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

  • Custom User Avatar

    Looks good! I ran it a number of times and was at least ~60 tests shy of passing each time.

  • Custom User Avatar

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

  • Custom User Avatar

    Sample tests and submission tests are using different types for current.

  • Custom User Avatar

    This was great! The work put into the description and tests was very much appreciated!

  • Custom User Avatar

    So it looks like this kata was retired, but for future reference, the issue with the implementation of the random tests was this:

    String randomString1 = generateRandomDecodableString();
    String decoded1 = Kata.decode(randomString1);
    assertEquals(Kata.decode(randomString1),decoded1);
    

    This test ends up comparing the solution's answer to itself, which will return true regardless of the correctness of the solution. Instead, you'll want to have your own code within the submission tests which produces the correct answer and compare the solution's result to that. Something like:

    String randomString1 = generateRandomDecodableString();
    String decoded1 = referenceDecode(randomString1);
    assertEquals(decoded1, Kata.decode(randomString1));
    

    where referenceDecode is a known correct solution.

  • Custom User Avatar

    You'll need more than one fixed test in your submission tests.

  • Loading more items...