Ad
  • Custom User Avatar

    Done!

  • Custom User Avatar

    It would be great if you add some random test cases.

    Good kata!

  • Default User Avatar

    Note that you're rounding the number n when you shouldn't do that, instead you should use the Math.floor function to get the nearest number of n which, if n would be 7.1, the nearest number will be -> 7.

  • Default User Avatar

    Hello pitieu,

    The sentence means, that the method/function can receive decimal numbers and if that would be the case then, it should return true only if the number (the decimal number that the method/function has received) is equal to its integer part and that integer part is odd.

    About your other question with the decimal number, this should be the returned value of the method:
    1.1 ->false
    7.7 ->false
    7.77 ->false
    1.01 ->false
    1.10 ->false
    1.12 ->false
    7.17 ->false

    This will return true
    1.0
    -5.0
    -9.00

    Hope the answer could help you!
    Have a good day.

  • Default User Avatar

    Java Translation added ;)

    Check it out!

  • Default User Avatar

    Hello bkaes,

    Thanks for the feedback. It's now fixed, the random test cases does not appear in the test cases just when the warrior make the final submit.

    @Darnor, I thought that both test cases should be the same.

  • Default User Avatar

    Hello Chobbes,

    As Darnor wrote, the description specify that if the method recieve an empty string or null, it should return "Invalid String!", that's why you should validate against null or empty strings.

  • Default User Avatar

    Hello Darnor,

    the test case for null or empty is already added.
    In addition, I add some random test cases and other little changes to initial code. ;)

  • Default User Avatar

    Hello great warrior, thanks for the feedback.

    Great question, but if the warrior which has decided to complete this kata use any of the sorting java methods, it would do the job by itself.

    Otherwise, if any of the warriors decide to do it manually then all non-letter characters have a number in the ASCII code, which mean they should make a comparison on which non-letter character has the greater number.

    If you have any other question, please ask.

    Have a good day.

  • Default User Avatar

    Hello laoris,
    thanks for the feedback.

    You're right, the method wasn't static yet because I made the changes in wrong place.
    But, it's fixed already ;) Thank you!

  • Default User Avatar

    Hello Darnor,

    Thank you for the feedback.
    I already fixed the method name, I really forgot fix it when I was creating this kata because at the beginning I thought to name it 'order' instead of 'orderWord'. But, it's already fixed ;)

    About the (e before d, you're wrong because according with natural ordering, it should be like in the test. For i.e.: Ordering.orderWord("rude") should return => deru).

    I'm working on more tests for the kata, thanks anyway.