Beta
Translate from Trinary
13oso0824
Loading description...
Binary
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.
This comment has been hidden.
Hi!
Sorry I'm slow to answer, been away for a while.
The space was originally left in there intentionally, but I forgot to remove it when I decided to only have correct test inputs. I'll fix that right away.
An emoji test would be fun, but I'd have to adjust my current solution before I do that!
As for your solution, I'm not quite sure where it goes wrong. The decimal for ? is 63, the trinary would be 002100. The decimal for ¤ is 164, the trinary would be 020002. I can't see why your code confuse these two. I would suggest testing the code with different inputs and see where things stop working.
The windows ansi (e.g) encoding for "¤" is 164 but the UTF8-Encoding for "¤" is: {194, 164} or in Trinary {"21012", "20002"}. The question mark means there is no valid UTF8 encoding given. As you can see in https://en.wikipedia.org/wiki/UTF-8 under the heading "Code point UTF-8 conversion" there are 2 bytes required for the character "¤" resp. ¤c resp. Ansi1252 = 164 The assert should be
Please note the inserted 021012.
This comment has been hidden.
I'm not quite sure what you mean by the first point, but I could make some random tests.
The first point means that when I want to solve your kata and open the kata trainer view, there is already some code for some unrelated problem (it is an example of C# kata. it is meant as help for authors, and should not be a part of a published kata).
Thanks! I didn't even think about that part. Forgive me, it's my first kata! I have fixed it now.