Morse code translator
Turn the words on the command line into Morse code. The starter already holds the code for every letter: 26 strings, and a table morse of 26 pointers to them in alphabet order, eight bytes each (.dword). The args box holds hello world. Change it and press run to try other words; check always uses hello world.
For each word from argv[1] on, walk its bytes with ldrb until the zero byte that ends it. Turn each letter into a table index ('a' is 0, 'z' is 25, and a capital counts the same as its lower-case letter), load the pointer at that index, and print the string it points to with %s. Anything that is not a letter prints ?.
Spacing matters, because the output is compared exactly:
- one space between the letters of a word
/between words- a newline at the very end
- with no words at all, print
nothing to sendon its own line and return 1 frommain
So hello world prints .... . .-.. .-.. --- / .-- --- .-. .-.. -...
What is checked
- the Morse line for
hello world(the args shown in the specification), and for more arguments you cannot see - the exit status (0 after a message, 1 with nothing to send)
- the words are read byte by byte (
ldrb)
specification
ldrbWe run your program on the input above and on the hidden ones, and compare what it does. Nothing is matched against a stored solution.