Ad
  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar
  • Custom User Avatar

    This is a rather simple kata that doesn't take nuances like this into account.

    For that, check out the next one:
    https://www.codewars.com/kata/decode-the-morse-code-for-real

  • Custom User Avatar

    Not sure what you mean, if 111 represents a dot rather than dash, how do you explain the seven zeroes?

  • Custom User Avatar

    True, that's not foreseen in this code.

  • Default User Avatar

    You're absolutely right, as that was not mandatory for this kata. Variation handling is the matter of the next kata in this serie: https://www.codewars.com/kata/54acd76f7207c6a2880012bb (which I didn't solve yet, padawan that I am!)
    Anyway, in case I didn't well understand you (morning power) and there really is a problem with my solution wrongly passing the kata, that's a bug in tests and has to be reported as such to the author.

  • Default User Avatar

    This code wouldn't work correctly if the sampling rate for the bits is high enough to expose the slight variations in timing that a human generating morse code would naturally make.
    So this code only works when the sampling rate for the bits is low and the bit string has no slight variation in timings dots, dashes, and the gaps between dot and dashes and spaces.
    For example, if the sample rate is high enough that the dots are sometimes 20 1's long but sometimes 21 1's long (which would happen regularly with a human sending morse code) then this code won't
    decode the bits correctly.
    Same thing if a space was sometimes 140 0's long and sometimes 139 or 141 zeroes zeroes long: this code wouldn't work correctly.

  • Default User Avatar

    This code wouldn't work correctly if the sampling rate for the bits is high enough to expose the slight variations in timing that a human generating morse code would naturally make.
    So this code only works when the sampling rate for the bits is low and the bit string has no slight variation in timings dots, dashes, and the gaps between dot and dashes and spaces.
    For example, if the sample rate is high enough that the dots are sometimes 20 1's long but sometimes 21 1's long (which would happen regularly with a human sending morse code) then this code won't
    decode the bits correctly.
    Same thing if a space was sometimes 140 0's long and sometimes 139 or 141 zeroes zeroes long: this code wouldn't work correctly.

  • Default User Avatar

    This code wouldn't work correctly if the sampling rate for the bits is high enough to expose the slight variations in timing that a human generating morse code would naturally make.
    So this code only works when the sampling rate for the bits is low and the bit string has no slight variation in timings dots, dashes, and the gaps between dot and dashes and spaces.
    For example, if the sample rate is high enough that the dots are sometimes 20 1's long but sometimes 21 1's long (which would happen regularly with a human sending morse code) then this code won't
    decode the bits correctly.
    Same thing if a space was sometimes 140 0's long and sometimes 139 or 141 zeroes zeroes long: this code wouldn't work correctly.

  • Default User Avatar

    This code wouldn't work correctly if the sampling rate for the bits is high enough to expose the slight variations in timing that a human generating morse code would naturally make.
    So this code only works when the sampling rate for the bits is low and the bit string has no slight variation in timings dots, dashes, and the gaps between dot and dashes and spaces.
    For example, if the sample rate is high enough that the dots are sometimes 20 1's long but sometimes 21 1's long (which would happen regularly with a human sending morse code) then this code won't
    decode the bits correctly.
    Same thing if a space was sometimes 140 0's long and sometimes 139 or 141 zeroes zeroes long: this code wouldn't work correctly.

  • Default User Avatar

    This code wouldn't work correctly if the sampling rate for the bits is high enough to expose the slight variations in timing that a human generating morse code would naturally make.
    So this code only works when the sampling rate for the bits is low and the bit string has no slight variation in timings dots, dashes, and the gaps between dot and dashes and spaces.
    For example, if the sample rate is high enough that the dots are sometimes 20 1's long but sometimes 21 1's long (which would happen regularly with a human sending morse code) then this code won't
    decode the bits correctly.
    Same thing if a space was sometimes 140 0's long and sometimes 139 or 141 zeroes zeroes long: this code wouldn't work correctly.

  • Default User Avatar

    This code wouldn't work correctly if the sampling rate for the bits is high enough to expose the slight variations in timing that a human generating morse code would naturally make.
    So this code only works when the sampling rate for the bits is low and the bit string has no slight variation in timings dots, dashes, and the gaps between dot and dashes and spaces.
    For example, if the sample rate is high enough that the dots are sometimes 20 1's long but sometimes 21 1's long (which would happen regularly with a human sending morse code) then this code won't
    decode the bits correctly.
    Same thing if a space was sometimes 140 0's long and sometimes 139 or 141 zeroes zeroes long: this code wouldn't work correctly.

  • Default User Avatar

    This code wouldn't work correctly if the sampling rate for the bits is high enough to expose the slight variations in timing that a human generating morse code would naturally make.
    So this code only works when the sampling rate for the bits is low and the bit string has no slight variation in timings dots, dashes, and the gaps between dot and dashes and spaces.
    For example, if the sample rate is high enough that the dots are sometimes 20 1's long but sometimes 21 1's long (which would happen regularly with a human sending morse code) then this code won't
    decode the bits correctly.
    Same thing if a space was sometimes 140 0's long and sometimes 139 or 141 zeroes zeroes long: this code wouldn't work correctly.

  • Default User Avatar

    This code wouldn't work correctly if the sampling rate for the bits is high enough to expose the slight variations in timing that a human generating morse code would naturally make.
    So this code only works when the sampling rate for the bits is low and the bit string has no slight variation in timings dots, dashes, and the gaps between dot and dashes and spaces.
    For example, if the sample rate is high enough that the dots are sometimes 20 1's long but sometimes 21 1's long (which would happen regularly with a human sending morse code) then this code won't
    decode the bits correctly.
    Same thing if a space was sometimes 140 0's long and sometimes 139 or 141 zeroes zeroes long: this code wouldn't work correctly.

  • Default User Avatar

    This code wouldn't work correctly if the sampling rate for the bits is high enough to expose the slight variations in timing that a human generating morse code would naturally make.
    So this code only works when the sampling rate for the bits is low and the bit string has no slight variation in timings dots, dashes, and the gaps between dot and dashes and spaces.
    For example, if the sample rate is high enough that the dots are sometimes 20 1's long but sometimes 21 1's long (which would happen regularly with a human sending morse code) then this code won't
    decode the bits correctly.
    Same thing if a space was sometimes 140 0's long and sometimes 139 or 141 zeroes zeroes long: this code wouldn't work correctly.

  • Loading more items...