7 kyu
Simple Fun #193: Moment Of Time In Space
391 of 940myjinxin2015
Loading description...
Fundamentals
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.
pretty fun problem!
python new test framework is required. updated in this fork
Approved
good kata
C# generate warning ->
tests/Fixture.cs(136,15): warning CS0219: The variable 'passed' is assigned but its value is never used
I feel like the instructions could be cleaned up a bit without losing the overall sentiment. I made some suggestions below, also available at the gist here..
Task
You are given a moment. You must decode the time and space of each moment to determine if it is in the past, present, or future.
Moments are given as a string of 8 characters (e.g. "11:01 pm").
Time is the sum of characters that increase time (i.e. numbers in range ['1'..'9']).
Space in the number of characters which do not increase time (i.e. all characters excluding those that increase time).
Your method should return an array of three elements representing [past, present, and future]. Two elements will be false, and one will be true. The true value should be at whichever index corresponds to the proper moment in time.
Past, present, or future is determined as follows:
Example
moment = "01:00 pm"
Time equals 1
Space equals 7
Time < Space, so the moment is from the past.
The output should be [true, false, false].
Geez.. Finally figure out what this taka wants me to do with the [Space] thing. Space should be the non-number and no-zero character in this given string like you listing there.
Thanks for explanations.
Sure thing! Glad you found it helpful! The instructions for this kata were making my head spin (and not in a good way), so I figured other people might be feeling the same.
can someone help me with one question. For moment = "01:00 pm", the output should be [true, false, false].
time equals 1, and space equals 7, so the moment is from the past. how we know that space equal 7?
This comment has been hidden.
C Translation kumited, (myjinxin inactive) ;)
This comment has been hidden.
done
Thanks!
Guys! It's good that you made the puzzle. But not all participants have English as their first language. They can't play on words ... Add the phrase to the end of the Kata Description: "And remember, time does not stand still." To understand "increase - do not increase".
If you feel you need to suggest updates to the description, by all means, do so. But please don't make it sound like you want all descriptions dumbed down to flavourless beginner's English because some people might not be able to understand every nuance.
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 + Tests cleanup + Description formatting fix
Fun kata, thanks!
Note, typo in the description:
"Otherwise, it is the preset moment." -- should be "present" :)
Thank you for your feedback. Fixed ;-)