7 kyu
Broken Collatz
14 of 595LegacyCrono
Loading description...
Debugging
Fundamentals
Recursion
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.
Almost duplicated (though this one is broken...) of a lot of Collatz sequences: https://www.codewars.com/kata/collatz-conjecture-3n-plus-1 https://www.codewars.com/kata/max-collatz-sequence-length https://www.codewars.com/kata/collatz-conjecture-length https://www.codewars.com/kata/collatz
The Kata Best Practices says that "Every new kata should ideally teach something different". This kata was designed as an introductory level exercise to teach about some key aspects of the Ruby/Crystal languages (specifically: function syntax, default parameters, the unless keyword, conditional suffixes and conditional expressions). They might use the same topic but I feel that they're fundamentally different.
the problem is that you can copy and paste a solution from one kata to this one. To avoid being a duplicate you need to translate exisiting katas because over time people will create translations for this kata and the originals and eventually they support all languages but are the exact same.
Sorry but I don't agree. The code from the kata I mentioned passes your kata without any change; it is what I have done. You don't even have to worry about the flaws of the "broken Collatz": copy and paste your old code. You should have, at least, introduce some variant: ie return an array with the values at each step, return an array with the length of the sequence and the penultimate term, return the length as a string, raise an error if some conditions are not fulfilled, etc... Your kata is still in Beta so you could change anything as your imagination wants:-) The solutions of the guys who have passed might be invalidated but that doesn't matter, they will keep their honor, Beta status is done for that! I don't want to fight with you:-)) but the issue is not resolved. Often @JHoffner retires the duplicates.
You should add random tests.
Resubmitted the kata with random test cases.
Good! You could have asked for 100 or 200 random tests; 10 is not enough.