Beta

Translate from Trinary

Description
Loading description...
Binary
  • Please sign in or sign up to leave a comment.
  • ah2023 Avatar

    This comment has been hidden.

    • oso0824 Avatar

      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.

    • ah2023 Avatar

      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. &currenc resp. Ansi1252 = 164 The assert should be

       Assert.That(source.FromTrinary("010210 010220 010221 010202 010222 010211 010221 010222 010222 010222 021012 020002 001101 001022 001020"), Is.EqualTo("fijekgjkkk¤%#!"));
      

      Please note the inserted 021012.

    • oso0824 Avatar

      This comment has been hidden.

  • rowcased Avatar
    • Solution Set-Up contains code for some other kata (I have tried resetting)
    • no Random Tests
    • oso0824 Avatar

      I'm not quite sure what you mean by the first point, but I could make some random tests.

    • hobovsky Avatar

      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).

    • oso0824 Avatar

      Thanks! I didn't even think about that part. Forgive me, it's my first kata! I have fixed it now.

      Issue marked resolved by oso0824 2 months ago