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.
same note about a priori dot is in previous kata, most likely it is needed to solve 111000111, and doesn help to resolve the issue
hi. It is still unclear for me, why we should clasify 1001 as '. .' .... we know that '.' is approximately 1. and we see two zeros. if we assume that '-' is approximately 3 (based on what we saw as '.'). two zeros are as close to 1 as to 3. what reasons do I have to say it is '-'
Of course, in real-life conditions (we're trying to kinda simlutate in this kata) NOT every message can be reliably decoded.
But the test cases for this kata are carefully selected so that they COULD be realiable decoded.
I disagree, there still is an issue. In this fuzzy algorithm it doesn't make sense to test for one or two letter messages. And especially the '1001' case is really questionable. In the kata description it says every message can be reliably decoded, but in my opinion that just isn't the case. Of course you can always tailor your code around the test cases, but that is kinda silly.
I'm closing this issue as it seems no longer an issue. :)
In fact, I've found a mistake in your logic. You say: "Dash should be AT LEAST 3 time units long". That's wrong. Dash should be APPROXIMATELY 3 times longer than dot.
The note you missed applies well if you have, say, 10 1-unit tokens (clearly, dots) and 10 3-unit tokens (clearly, dashes) and then you encounter a 2-unit token. Then the note is applied and makes that 2-unit token a dot.
The same goes to 101 - because all the tokens are of the same length, you have to use the same note to treat them all as dots, not dashes.
But starting with 1001 we see two different lengths, so we have more information, and that not is not needed.
There's a note in the kata description on this particular issue: "if you have trouble discerning if the particular sequence is a dot or a dash, assume it's a dot".
Of course, in real life a human receiver would not be able to discern a dot from a dash on such a fuzzy and short message, so those "tiny tests" are not exactly relevant, but their purpose is to tune your algorithm so that it could work consistently.