Ad
  • Custom User Avatar

    Hi,

    Description and test cases updated!

  • Custom User Avatar

    Thanks @WWW21!

  • Custom User Avatar
    • I changed the name of the title (it now tells people the idea of the kata)
    • I rewrote the test structure by adding more tests (including 100 random tests)
    • I added example test cases
    • I updated the description to describe (and show, with examples) what the purpose of the kata is

    Please mark as resolved if you think these updates have fixed the kata!

  • Default User Avatar

    Agree with all the above. For now there is too much guesswork involved in solving this kata.

  • Default User Avatar

    I'll be working on that, thanks.
    Haven't had the chance to work on this yet.

  • Default User Avatar

    Thanks for the feedback!

  • Default User Avatar

    Would you happen to have any solution for dealing with extra large numbers?

    I am finding that the function gets fairly unpredictable if a number with more than 10 digits is passed.
    I thought about adding a rule that would limit the user to less than 11 digits. Then the solution code would
    have to include some sort of logic like:

    if len(str(cents)) > 10:
        cents = int(str(cents)[:10])
    

    But that seems fairly ugly. I tried to do some research to figure out a better way to deal with it but came up
    empty handed. Any advice would be greatly appreciated.

  • Custom User Avatar

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

  • Custom User Avatar

    The users have to follow the design, no matter if they understand it or not.

    Test cases are explicitely not using assertEquals to not show the test cases easely.

    Unknown error is not thrown by any of my test cases.

    Increasing the dictionary length discouraged a lot of people doing the exercise, this was already a previous change, this also encourage different solutions.

    1. The encode method should return an empty String if a null parameter is passed. (this is taken from description)