Ad
  • Default User Avatar

    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

  • Default User Avatar

    Will this remove trailing spaces on line without markers?

  • Custom User Avatar

    What should be the result of decodeMorse(decodeBits('1110000000111'))?

  • Default User Avatar

    The test cases need to be expanded -- multi-character markers, things that need to be Regexp escaped, etc.

  • Default User Avatar

    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

  • Custom User Avatar

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

  • Custom User Avatar

    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 call center, now with the argument [4,5,6]. This time, we get cen = 5 (since (3/2 = 1)). This is not an array, and so the cen 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 returns nil. Someone please explain :)