Published on InterSystems Developer Community (https://community.intersystems.com)

Home > DC Challenge: If you can read this...

Discussion
Eduard Lebedyuk · Jul 8, 2021

DC Challenge: If you can read this...

Hey Community,

Here's a new CodeGolf challenge for you! Check the details in this post.

image

Task

You'll have to translate a string into a Pilot's alphabet (NATO phonetic alphabet).

Input:

If, you can read?

Output:

India Foxtrot, Yankee Oscar Uniform Charlie Alfa November Romeo Echo Alfa Delta ?

Note:

  • The set of used punctuation is ,.!?
  • Punctuation should be kept in your return string, but (original) spaces should not
  • Xray should not have a dash within
  • Every word and punctuation mark should be separated by a space ' '
  • There should be no trailing whitespace
  • Use this code to check the result length
  • You also can use this test case here

Share your solutions in comments!
Shortest answer wins!

Code Golf index

#Code Golf #InterSystems IRIS

Source URL:https://community.intersystems.com/post/dc-challenge-if-you-can-read