Omnimaga

Calculator Community => Contests => Community Contests => Topic started by: LDStudios on July 13, 2015, 12:55:55 pm

Title: Codegolf - The Reboot #7
Post by: LDStudios on July 13, 2015, 12:55:55 pm
Sorry this is a bit late but...

Stranded on a strange alien planet, you are picking up morse code signals from Earth. Unfortunately, you aren't very practiced with morse code, so you create a program to interpret and translate it. Unfortunately, the alien computer you are using doesn't have any number keys, and you have no way of using any numbers in your code.

Challenge
-Create a program that can convert a string made up of "_" and "." into letters.
-You may not use any numbers.
-The input can be in any form you want, and letters should be separated by spaces; paces between words are separated by multiple spaces.
-Any number of consecutive spaces greater than one in the input, should be represented by a single space in the output
-Outputs should be in all upper case
-Any combination of "_" and "." that doesn't make sense returns a "!"

Example
Input:
Code: [Select]
".... ..        _ .... . . ....."
Output:
Code: [Select]
"HI THERE!"

Use this key to convert morse code to letters:
(https://kidavalanche.files.wordpress.com/2010/04/morsecodeletters.jpg)

SCORES:
Ranking:         User:                   Language:                    Score:   
1.                    Juju                     Ruby                             175         
Title: Re: Codegolf - The Reboot #7
Post by: Juju on July 14, 2015, 01:58:22 am
Interesting challenge here. Got it down to 175 bytes, despite not having any numbers.
Title: Re: Codegolf - The Reboot #7
Post by: TIfanx1999 on July 15, 2015, 08:28:26 pm
I don't know if I'll get around to it, but this looks like a very interesting challenge. :)