5
1
Input: A single word as a string (matches [a-zA-Z]+
). If the input doesn't follow these guidelines, print "Error" (but no error should be thrown)
Output: The NATO pronunciation of the word. Print out a space separated list of the NATO word that matches each letter of the input word. Trailing white space is acceptable.
Restrictions:
Your source code must contain each ASCII character from 32 (space) to 126 (tilde) in that order, excluding numbers and letters. You may have anything you like mingled in between the required characters, but the required characters must be there and in order. (If ABC
were the required characters, YA8iBC3
or C6ABn#C
would be valid, but A7CRT
or 8mdB9AC
would not be).
Standard loopholes and built-ins for generating the NATO pronunciation are not allowed.
References:
The NATO pronunciation is as follows: Alpha Bravo Charlie Delta Echo Foxtrot Golf Hotel India Juliet Kilo Lima Mike November Oscar Papa Quebec Romeo Sierra Tango Uniform Victor Whiskey Xray Yankee Zulu.
The required symbols (in order) are as follows: !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
Test cases: (The quotation marks won't be part of input, but are included to show whitespace)
"a" => Alpha
"Z" => Zulu
"twig" => Tango Whiskey India Golf
"PPCG" => Papa Papa Charlie Golf
"camelCase" => Charlie Alpha Mike Echo Lima Charlie Alpha Sierra Echo
"Quebec" => Quebec Uniform Echo Bravo Echo Charlie
"" => Error
" " => Error
"()" => Error
"twig " => Error
" PPCG" => Error
"one+two" => Error
"Queen bee" => Error
This is a code-golf, so the shortest code in your favorite language wins!
9+1 for the basic challenge idea but -1 for the (in my opinion) odd and unnecessary restrictions. – Alex A. – 2015-12-28T18:30:11.913
1Wtf those strange restrictions?.. What's the use of making
!"#$%&'()*+,-./:;<=>?@[\]^_\
{|}~` required? – nicael – 2015-12-28T18:49:06.3171@AlexA. The restrictions are the core of the challenge. The rest of the challenge is simply the framework to present the restriction. – Nathan Merrill – 2015-12-28T19:32:53.793
Let's say wed have met the requirement while writing the source code, can we use those characters afterwards? – TanMath – 2015-12-31T17:14:29.270
Yes. You can use the symbols as many times as you'd like. – Nathan Merrill – 2015-12-31T21:26:16.070
Really? They use Golf? Weird.. – CalculatorFeline – 2016-03-14T20:51:48.240