Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
DC=
meansD
=> 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 bitshwLA
=> 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]
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 !
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 ?
I added random testing, thank you for pointing this out !
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 !
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 ?