6 kyu
Big to Little Endian
131 of 141maerch
Loading description...
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.
COBOL translation (author is inactive).
approved
This comment has been hidden.
Any idea why I can't fork this? Why I try, the
SAVE
button is shaded out; nonfunctional.General bug on CW currently, same thing everywhere :/
I broke it when I fixed something. I'll deploy the fix soon.
Deployed the fix
Ruby Fork
please check carefully, thanks
approved
fork provided in above
issue
approved
I have never touched Ruby before. Still, only took about 30 seconds to write an solution. And then 30 minutes figuring out how to raise an exception without getting an error. In the end, I gave up and forfeited because everything I tried gave an error. Turns out, I wrote the exception correctly all along, I just checked the integer against 0xFFFFFF instead of 0xFFFFFFFF. FML.
You should have more test cases to at least check for max integer allowed.
This comment has been hidden.
This comment has been hidden.
!
You could apply some markup to the description. I suggest this:
Oh! Yeah! Looks better now! This also helps to make better katas in the future. :)
Thank you so much for your efforts! I really appreciate that!
U r welcome :)
The kata is nice, but I had one difficulty. After reading description, I thought that argument is a signed integer, but it appeared to be unsigned when tests haved failed. It should be noted in briefing, shouldnt it?
I have added a note about that in the description! Thank you!
Gj :)
Your code example calls the method
nonh
instead of ntoh.Personally, I would prefer calling the method something more readable, like
switch_endian
.Oh yeah! Thanks! I made the change!
Regarding the method name I am not sure. On the one hand readable names are always a plus, but on the other hand "ntoh" and "hton" are quite established method names in operating systems for this matter. I thought this would bring some recall value later on for someone seeing this method names somewhere else.
But should be a readable name more prefereable to the Codewars community, I can change that. This is my first kata and I am eager to learn!
If those are de facto standard names, I think you should keep them. I agree with your recognition idea.
And congratulations to your first kata. You did a good job! :-)