7 kyu
Simple Fun #149: Next Day Of Week
186 of 355myjinxin2015
Loading description...
Puzzles
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.
Haskell translation
python new test framework is required. updated in this fork
Forked & Approved
Ruby translation should be updated 3.0, see relevent information here: https://github.com/codewars/content-issues/wiki/List-of-Ruby-Kata-to-Update
Enabled in this fork
I think there is an issue with the Crystal/Ruby version :
Test.assert_equals(next_day_of_week(7,3),6)
Why is the answer 6 ? 3 is reprsented in binary as the following0000011
The 5ths bit is not a positive bit ... the answer should be 1 ... Or is there something I'm missing ?Surely, it's a wrong result. Two translations from @GiacomoSorbi. Let me try to fix it ;-)
Ruby fixed. Please help me re-test it.
Test cases seems good, thank you :) The sample tests cases are still wrong though ;)
I've fixed it, but you can not see the changes until you solve it and train again.
Crystal was fixed now. Please test ;-)
Seems all good, thank you
Many thanks for your help ;-)
Just out of curiosity: why doesn't the week start with monday?
All I know is that most calendars are in this order. But I don't know why too.
Interesting. I don't recall ever seeing such a calendar. The ones I have around all start on monday and the one on this operating system, too. Maybe it's an American thing. They also use outdated European units of measure and a weird date format, that puts the day in the middle.
China's calendar also start from sunday. I don't know Japan's calendar ;-)
https://en.wikipedia.org/wiki/Sunday
It was common at a time in Europe, too, but it was upgraded (ISO 8601).
Contrary to what my name and some of my kata would suggest, I'm not Japanese. Though, now that you mention it, Japanese calendars also start with Sunday.
Ruby and Crystal, cheers :)
Done. Thanks ;-)