Ad
  • Custom User Avatar
  • Default User Avatar

    Instead of 'break', you should use 'continue'.

  • Default User Avatar

    I just added clarification to the description. Hopefully it will help people understand the objective of the kata.

  • Custom User Avatar

    @isimon I thought this was really a good Kata but lots of people seem to struggle to understand it, and now the "satisfaction" rating is suffering because they are voting it down. Please consider some of the suggestions for improving the description so it gets the rating it deserved!

  • Custom User Avatar

    @dinglemouse
    Thanks for the explanation. I noticed the sections rule but couldn't figure out what the purpose was, as it isn't clear from the examples what the significance is or what a day is in terms of the array.

    To be more clear the description should say something along the lines of:

    • "A day is made up of morning, afternoon, and evening (every 3 values in the array is a full day)" - then followed by the other rules, perhaps nicely formatted.
    • When it rains or there is a thunderstorm he takes his umbrella out of his backpack and when it stops raining he puts it back.
    • Every day starts with his umbrella in his backpack.

    How many times does Joe take his umbrella out of his backpack?

    You will receive an array of weather conditions, possible weather conditions are sunny, cloudy, rainy and thunderstorm.

  • Custom User Avatar

    RTFM

    His day is divided into three sections the morning, afternoon, and evening

    and

    Every day starts with his umbrella in his backpack

    So (your first example)...

    Day 1

    • morning: rainy -0+1=1
    • afternoon: rainy - do nothing (he already has the umbrella out)
    • evening: thunderstorm - do nothing (he already has the umbrella out)

    Day 2

    • morning: rainy - 1+1=2
    • afternoon: rainy - do nothing (he already has the umbrella out)
    • evening: cloudy - put umbrella back in pack

    result = 2, expected = 2.

    QED

  • Custom User Avatar

    @isimon even if he needs the umbrella during a thunderstorm, the examples are still unclear(to me at least):
    First example:
    rainy - OUT (1)
    rainy - DO NOTHING
    thunderstorm - DO NOTHING
    rainy - DO NOTHING
    rainy - DO NOTHING
    cloudy - IN
    = 1, expected 2
    Even if lets say he puts it back at the end of a thunderstorm no matter what, it still doesn't work for test cases.

    4th sample test:
    rainy - OUT (1)
    cloudy - IN
    thunderstorm - OUT IN (2)
    sunny - DO NOTHING
    cloudy - DO NOTHING
    rainy - OUT (3)
    rainy - DO NOTHING (3)
    cloudy - IN
    sunny - DO NOTHING
    = 3, expected 4.

    Maybe I'm missing something, but I don't see how this can work from what we have.

  • Default User Avatar

    Yes. I'll add that to the description.

  • Default User Avatar

    Yeah, my bad. For some reason I thought that you couldn't change the comment type.
    Anyway, the only reason you had an immediate response was because you marked your comment as an issue instead of a question, which it should have been.
    You make the kata author lose points if you mark it as an issue. If you had just re-read the description, you would have known what you were doing.

  • Default User Avatar

    maybe :P

  • Custom User Avatar

    Maybe he deleted it and created a new one? It's possible I guess if it had no answers. But then he had no patience to get the answer ;)

  • Default User Avatar

    Well thats BS because you can't change the comment type after it has been posted.

  • Custom User Avatar

    Read the description again. Why are you breaking out of the loop? It says +0 for each blank answer(empty string). so you shouldn't break out, just add 0. Also, this is not an issue, mark your comment as "question" next time you don't know the answer to the problem.

  • Custom User Avatar

    Not true, and you can always use Question instead. There is also a gitter room where you can chat about kata solutions.

  • Default User Avatar

    When there is a problem with your code, don't mark it as in issue as it is not a problem with the kata.

    Don't try to count all the odd numbers, the tests are way too large for that. Try using math instead

  • Loading more items...