Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Morse Clock by mrpoush
def to_bin_digit(n, digits):
return (bin(n)[2:].rjust(digits, '0')).replace('0', '.').replace('1', '-')
def to_binary(value, tens_size):
return ' '.join([
to_bin_digit(int(value) / 10, tens_size),
to_bin_digit(int(value) % 10, 4)
])
def checkio(time_string):
return ' : '.join(map(to_binary, time_string.split(':'), [2, 3, 3]))
Dec. 18, 2014
Comments: