Ad
  • Default User Avatar

    Ah got it, DOH!

    Thanks!

  • Default User Avatar

    In my local code, I pass 'Oay emporatay oay oresmay !ay' into my function, and it returns 'Oay emporatay oay oresmay !' So is this the wrong way round?

    Test.assertEquals(pigIt('Oay emporatay oay oresmay !ay'),'Oay emporatay oay oresmay !')
    

    I added it later, to see if it was actually failing, it was an error from the ATTEMPT.

  • Default User Avatar

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

  • Default User Avatar

    Test case

    Test.assertEquals(pigIt('Oay emporatay oay oresmay !ay'),'Oay emporatay oay oresmay !') // PASSES ON TEST
    
    expected 'Oay emporatay oay oresmay !ay' to equal 'Oay emporatay oay oresmay !' // FAILS ON ATTAMPT
    

    What am I missing here?

  • Default User Avatar

    Ah, I see, the description is quite confusing to be honest. I understood the output to be the floor moved to, but it is actually the difference and direction traversed between levels.

  • Default User Avatar

    Why does one test say "0 should be -1" ?? I thought the levels begin on level 0?

  • Default User Avatar

    Now thats learning something new!

  • Default User Avatar

    Random test cases include lowercase and 'NoneType' characters

  • Default User Avatar

    "The problem is not to understand the description but to find how to solve the kata."

    This is a rather abstruse and confounding line. Surely, if one has issues with the description, the far more difficult it is to solve the Kata?

    I am also a native English speaker, and the description is very confusing indeed. The Math description with water weight to me, is unclear. For example, in your description you suggest a water loss of 1 percent accounts for 50 percent loss in overall weight. How does this follow if the water is 99% of the overall weight?

    Despite this issue, which of course, could be my own personal confusion with it, the Math involved should be using Floating Point precision not integers. It will be quite a hack to get this working on Integers.

  • Default User Avatar

    I have been struggling with that one too!

  • Default User Avatar

    Dang! Didn't know about that all function! Super Sweet!