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.
If the sequence is not optimal it will fail, just put an extra 0 in the HEY JUDE to see the result. String replacement might be clever but does not catch the variations of the keyer. Which is the problem with all computer-based CW-decoders
Will this remove trailing spaces on line without markers?
What should be the result of decodeMorse(decodeBits('1110000000111'))?
The test cases need to be expanded -- multi-character markers, things that need to be Regexp escaped, etc.
Hello, I'm a beginner to ruby and coding in general, can you explain to me each little part of the code? I'm trying to understand how you got it to work and it's just not happening
"It should return nil if there is no single center element."
I think your matrix doesn't have the single center because the matrix size is 3x2. In order to have single center all the matrix dimensions must be odd in size.
Maybe it's becuase I'm tired, but I don't understand how this function returns
nil
for the matrix[[1,2,3], [4,5,6]]
.In the first run, we get
cen = [4,5,6]
(2/2 = 1
), which is an array, and so the program proceeds to recursively callcenter
, now with the argument[4,5,6]
. This time, we getcen = 5
(since(3/2 = 1)
). This is not an array, and so thecen if mat.size.odd?
statement executes. The size of[4,5,6]
is 3, which is an odd number. So I don't understand how this returnsnil
. Someone please explain :)