Earn extra honor and gain new allies!
Honor is earned for each new codewarrior who joins.
Learn more
  • 14909989?v=3

    Returning empty array for empty timetable makes no sense whatsoever. It should return empty string.

  • 14909989?v=3

    Test cases starting from the 5th are vulnerable to input modification.

  • 39242962?v=4

    I passed all tests, but have the error:
    TypeError: d[0].toUpperCase is not a function
    at makeReadable
    at solution
    at /home/codewarrior/index.js:178:45
    at /home/codewarrior/index.js:226:5
    at Object.handleError

    Can you help with this issue?
    
  • 13890923?v=3
  • Profile pic

    This kata was challenging for me, but I enjoyed it very much and learned a lot. Also, I think this one was very well crafted. A complex problem to solve, but not because it was hard to figure out what the problem was asking for. Well done.

  • F6d261261425b72bba389146c4cf2d2e?d=https%3a%2f%2fidenticons.github.com%2fe4d3327424a571ee79716166d615bed3

    Ah, okay. Strictly, the wording is correct, but it's easily misread. Maybe some tweaking of the wording would help? But re-reading it, it makes sense.

  • 13890923?v=3

    It shouldn't be concatinated because working days will be only Monday and Friday not all days from Monday to Friday.
    And seems that you've put logic for this right here: if ... (last.order === d.order - 1), please correct me if I'm wrong.

    Thank for notice about empty array, probably null will be better.

  • F6d261261425b72bba389146c4cf2d2e?d=https%3a%2f%2fidenticons.github.com%2fe4d3327424a571ee79716166d615bed3

    "You may be given an array only of Monday and Friday with the same hours, but they shouldn't be concatenated." --Why? And what about such a situation should mean nothing would be concatenated? I haven't put any logic in that handles this, and it passed just fine.

    "If the array is empty, it just returns an empty array." --Seems strange to return a different format type (other than something like null). I would've thought we'd return an empty string, as if it were a blank sign for the working hours.

  • 13890923?v=3

    No problems, thank you a lot!

  • 21692852?v=3

    Fixed a few things for you, hope you don't mind. Your results and expected results were in the wrong order (you were saying "expected: [the user's solution], instead got: [actual answer]"), added Test.describe() to random tests (not to fixed tests due to formatting issues), protected the random tests from input modification and bumped number of random tests from 20 to 100, which is standard :)

    You might want to add variation to the times in the random tests though, as @ZED_CWT loves to hardcode whenever he can get away with it ;)

    (He only does it to point out weaknesses in the test, but the point is well-made).

  • 13890923?v=3

    Thanks for feedback, BTW it's my first kata :)

  • 21692852?v=3

    ^This.. and also, assertEquals is preferable to assertSimilar because it's already a string so we don't need it and it's a bit more readable (fewer escapes).

  • 1228739?v=3

    The second test in the sample tests expects a trailing '\n'.

    BTW: processData(data) are the most generic function and argument names I've ever seen. How about readableTimetable(workdays)?