>>108350855
in d this is just
import std;
immutable morse = [
"-----", ".----", "..---", "...--", "....-", ".....", "-....", "--...",
"---..", "----.", ".-", "-...", "-.-.", "-..", ".", "..-.", "--.",
"....", "..", ".---", "-.-", ".-..", "--", "-.", "---", ".--.", "--.-",
".-.", "...", "-", "..-", "...-", ".--", "-..-", "-.--", "--.."
];
const int[string] decodeMap;
shared static this() {
decodeMap = morse.enumerate(1).map!(r => tuple(r[1], r[0])).assocArray;
}
Comment too long. Click here to view the full text.