6 kyu
Parity bit - Error detecting code
343 of 894pshp
Loading description...
Algorithms
Binary
Strings
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.
python new test framework is required. updated in this fork
Approved
C translation (author inactive)
PHP Translation available for review. TY for the Kata :)
Ruby 3.0 should be enabled.
Enabled in this fork
This comment has been hidden.
This is my first bit of discourse so forgive me if I've not done this correctly. Is it intended that the Python random tests sometimes test against an empty string?
Yes, that is intended. Empty lists ( empty strings ) are perfectly legal and should be handled.
In fact, there should really be a fixed test with an empty string; testing solution behaviour for that input should not be left to the vagaries of a random generator.
Julia translation
Scala translation available for review.
Am I misreading your explanation...or in your examples have you mistakenly marked the fourth group of characters — 01010110 — as an error when actually it is not?
It was a mistake on my part. Well spotted, thanks.
Hello, this is my first kata and i'm not sure what's wrong. The code worked in chrome browser but not here.
I get this error: ReferenceError: document is not defined at parityBit at Object.handleError at ContextifyScript.Script.runInThisContext at Object.
the code:
https://gist.github.com/CrazyBadTurtle/d611c8f8c668cf3386a35c6e30ea2397
Hi! On Codewars you don't want to do document.write -- in most cases you just need to have your function return a value (unless a kata is specifically asking you to write a class or something else).
Hey! thank you for the answear, that solved it.
it works now, but i should work it down to a decent size :)). Your code seems much more effective.
This comment has been hidden.
That was a mistake on my part, well spotted.
Fixed.
Fixed in ruby, too
Ruby and Crystal translation submitted as well :)
Amazing, thanks.
I just did a Python translation for you at https://www.codewars.com/kumite/584f0dfd31c707b8780001e7 -- check it out and you can approve it if you like it.
Great!
Your choice of course, and it doesn't really really matter, but generally, for ASCII text, the most significant bit is used for parity, not the least significant bit.
I wasn't aware of that, so the parity bit should be on the left side of the binary string? I think I will keep on the right as that is how it is shown on wikipedia. I don't want to confuse people that are learning how they work for the first time.
The most significant bit may very well be the last bit, there's no contradiction here.
6 languages, almost 600 solutions, too late to make such breaking changes