Ad
  • Custom User Avatar

    I was bored so I copied your code and added a print statement near the end. Before converting from float to int, it printed something like 59.9999999999..., the expected result was 60 and your int was 59. If done on paper, those inputs indeed should return 60.0000000... or 60, so the programmed function doesn't match the description. I'm no programming guru but I think its a case of one of those small changes that sometimes happens when using floats. So your solution is correct except for the occasional "off by one" -error caused by floating point calculation. My hint is to reduce the number of floating point operations one way or another.

  • Custom User Avatar

    Input String: ArUYAqjuAuqrujAqAju.
    Random Test => assertion failed: (left == right) left: 1023145616406514156, right: 1023145212402514152

    My calculation yielded the value on the right.

    In this case 'U' and 'u' do not share the same digit in the expected value(left). One is 2 and the other 6.

  • Custom User Avatar

    All test folowing same pattern: assert_eq!(expected, convert(s)); even random one.
    For the random test expected value is calculated when it is needed.
    If you believe your solution is right please post here the values you geting: input string, expected value and your calculated value (dont forget mark post as spoiler).
    Without knowing thouse values I can't check if here is an issue with the test.
    Thanks for your report.

  • Custom User Avatar

    Awesome, thanks for the nice kata!

  • Custom User Avatar
  • Custom User Avatar
  • Custom User Avatar

    @hobovsky

    assertion messages are wrong

    I've fixed that(I think you are talking about swapping of actual and expected), if you think that's not the case please give me an example.

    Edit: Reference solution and description was inconsistent, I gave priority to description and changed the reference solution, now this should be fine in Java.

  • Custom User Avatar

    It is true, I already confirmed the issue below. There are two problems in Java:

    • specs on case sensitivity are wrong,
    • assertion messages are wrong

    These two factors make debugging of the kata really fun.

  • Custom User Avatar

    I'm pretty sure that's not true, but if it is, could you provide an example of such input and what's expected value?

  • Custom User Avatar

    The test fails in JAVA with mixed case because this is not true:

    • Same letters share the same digit regardless of case
      In reality the test wants different number from same letter UPPER/lower case
      Eg. A->1 ; a->2
  • Custom User Avatar

    Yes, the problem is with actual and expected values, where same letters do not share the same digit regardless of case

  • Custom User Avatar

    Which language?

    Help us help you.

  • Custom User Avatar

    When I run the random tests, I print my result in the console.
    Then it says I fail but the string I printed in the console does not match the output it says I failed.

    My print result: 1021234035000340607

    Message: "Input was: wLrwraYlaFLlLaYlclK,
    excpected: 1021234035000340607,
    but was: 1021234536050345758 ==>
    expected: <1021234035000340607>
    but was: <1021234536050345758>""

  • Custom User Avatar

    Is the problem that actual and expected values are switched in the test asserts?

    This can make for surreal failure messages. It's also easy to diagnose and easy to fix, without all the "I think .." and "Maybe ..".

    If you are going to post an Issue, in general, you should be sure it's actually a kata issue, which means you pretty much have to know what the problem is.

  • Custom User Avatar

    I am doing this Kata in Rust and i think there is a problem with the Random tests.

    The random test keeps failing but when I test the input string with my soulution it gives the expected answer.

    Maybe there is a difference between the test string and the expected string ??

  • Loading more items...