5 kyu
Department scheduler [simple]
87 of 150MMMAAANNN
Loading description...
Scheduling
Algorithms
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
The parameter name in all languages for
month
is kinda misleading because the format given is inMMYYYY
It's assumed that you should return an array of arrays with n names in it, but:
Why there is
three
in the description when each day array should containn
employee names?Description should be language-agnostic
Fixed all points, in all languages.
It's assumed that you should return an array of arrays with
n
names in it, but:Output
Why there is
three
in the description when each day array should containn
employee names?Because
Sorry, but it seems you are wrong: you have provided the example test, for which
n = 3
, indeed, — but I was asking about the overall output — becausethere must be *n* people at work each day
. Surely there are tests wheren = 2
or4
or9
, aren't there?I don't think you really understood the problem.
It is your task to find a way to make n people work each day.
Usually
Output
paragraph has been written for the common case and for all possible testcases — in this kata, the paragraph is correct only forn = 3
, while for others it's not.Ruby 3.0 should be enabled.
Enabled in this fork
whats the matter with this..
format_message
return message.replace("\n", "<:LF:>")
AttributeError: 'tuple' object has no attribute 'replace'
(python)Your message is unclear. I don't see anyting titled "format_message" in the Kata code. What your message says is you cannot replace anything in a tuple (obviously, because a tuple is an immutable type). Please explain where you saw this if you want further assistance.
full error ;
OMG, this looks like an error somewehere in the framework that runs tests, not in the test suite code itself. Somehow it fails because it cannot handle tuples properly.
Or, you know, the tests are broken?
https://github.com/Codewars/codewars.com/wiki/Codewars-Python-Test-Framework-V2#truthness-test It looks conformant with the statement
test.expect(boolean, message)
- do you see a problem or have a suggestion of a fix?Can I please see your solution so I can test this?
This comment has been hidden.
In which reality does a non-string qualify as a message? And by writing
Test.expect(actual == expected)
you're practically asking for trouble.Okay, thanks. I found the bug. You don't see the full contents of test suite yet. The
validation
variable contains the actual message of what is wrong, not the expected value. If that message is empty, this means you've passed the tests on the case. Hence comparison of validation results with empty string - and it is absolutely okay for this context.My bug was in another line of the test suite, where instead of string substitution there was a tuple (due to a typo). This bug is now fixed. You can continue debugging your solution now (it still needs work).
The sample tests don't work in Python 3 because the print statements have a bare argument. You need to change
print result
toprint(result)
in both cases and then it will work in both Python 2 and Python 3.This site did not have py3 support when the kata was written. I have updated the example cases so now it should work.
Wow. One of the finest katas I've seen so far. So I'm really sorry to bother with this fine kata and it's a really small complaint.
The descriptions says the format of the month is mmyyyy while I think the ruby tests actually do mm/yyyy.
I am not sure about Ruby as I do not have much experience with that language (Giacomo did the translation), but from looking at the code I think that the data is actually passed in mmyyyy format, not mm/yyyy format. Please do not confuse what is passed to the function with what is shown in the console, as the slash is actually being inserted in the console output describing the test.
Please re-check whether the issue actually exists and if it does not, mark it as resolved.
Thank you for your kind words about my kata! I am conceiving a much more complicated variation of it, but it will be published in Python (and I cannot say when it gets published, as I have some unresolved things yet). Keep looking at the katas I author if you don't want to miss it :)
I think you're right, but it still feels confusing that the output in the tests differs from the input. But it's a very small issue so I don't bother you anymore. (:
JS translation submitted and it was quite the bloodbath :D
I hope now everything is fine, if not just let me know :)
Thank you very much!
Ruby translation submitted too :)
Oh, while I am at it, I must complimenti you for all the work in creating the tests (which in this case was much, much harder than solving the kata itself); some of your ideas were also as interesting as elegant: kudos!
Thanks!
I am getting an error when trying to approve your translation:
Description cannot be approved, recent changes from related record must be merged first.
What should I do?
I finally found how to resolve this. I had to change description so that it corresponded to the initial state before your Ruby translation.
Funny thing is that the description edit that prevented me from accepting your Ruby translation was actually made by you during JS translation. (
None
=>None/null
).Yeah, it happens when someone changes the description (in this case it was still me); apparently copy&pasting the new description didn't work either.
Sorry for the inconvenience: next time just have me fork the translation with a more recent description, so to spare you some annoyance :)
That said, I hope the aforementioned next time will come soon, as working with you is surely a pleasure :)
Oh, there still are a couple of Geometry katas untranslated, and I would really appreciate your help there! In the meantime, I have some plans for harder similar scheduling katas and for some more geometry katas too.
It's probably worth including some rules about the leap years. :)
I thought it was obvious that the year can be a leap year. Please suggest wording if you think it is a necessary clarification.
I thought that was obvious too, but usually Christian has a better hand in dealing with descriptions and instructions than mine, so I took the liberty of adding one final paragraph to the kata description.
[Also: JS and Ruby versions should follow shortly if I don't encounter any serious problem in translating them]
Thank you! Looks fine.