Ad
  • Custom User Avatar

    DC= means D => 4 bits encoding so there is no confusion possible as we have 6 bits of length, C means 00 00 11, result is [0] (the = could be safely ignored)
    ChwLA= => 3 bits
    hwLA => 100 001 110 000 001 011 000 000
    => could be [4, 1, 6, 0, 1, 3, 0, 0] but as we have the = flag,
    we know we could remove the trailling zeros so the real result is [4, 1, 6, 0, 1, 3]
    So the = as a real meaning in this case here to differenciate [4, 1, 6, 0, 1, 3] from [4, 1, 6, 0, 1, 3, 0] or from [4, 1, 6, 0, 1, 3, 0, 0]

  • Custom User Avatar

    Yes exactly, that’s why when you said "wouldn't it just be fun if non-ambiguous endings could be encoded the same way ambiguous endings have to be?" it doesn’t seem to be possible !

  • Custom User Avatar

    Hello @Johan Wiltink

    Indeed, I could remove the requirement of empty string when we have an empty array in the encoder !

    We could encode non-ambiguous endings the same way as ambiguous when the last chunk is not exactly 6 bits, but when it does, we need a flag (or a way) to determine if we have to remove last bits or not at decoding time, how else would you do it ?

  • Custom User Avatar

    I added random testing, thank you for pointing this out !

  • Custom User Avatar

    Thank you for your reply @Johan Wiltink !

    I’ve updated the kata according that, now random tests are using the decoder to check for idempotent and it’s working fine :)

    Thank you for this suggestion !

  • Custom User Avatar

    Hello @JohanWiltink and thank you for all your great feedback!

    I’m not sure to understand perfectly your comment about decoder, do you mean the kata should be focus on decoding instead of encode, or should it be on decoding and encoding, or you’re talking about the validation tests, where I should write tests which use the decoder to validate the idempotence of the solution ?