Search results
Results From The WOW.Com Content Network
I created a string of alphanumerics such that their placement in the string describes their Morse code representation. Originally I was going to use binary, but 01 would be the same as 1. So I used ternary with - = 1 and . = 2. Thus is character c is at index 1121 in this string, its Morse code representation is --.-.
Because Morse code is a variable-length code that uses between 1 and 4 symbols for each letter, the tables 31313855 (bit 1) and 60257815 (bit 0) can together represent one less than the length of each letter's code.
The string literal is Morse code setup as a binary heap in array form. VB.NET lets you index strings as arrays of characters. The \ is integer division, taking the left sub heap for 1 or the right sub heap for 111. I used ! as a blank for when there isn't a value in that heap spot. It's only necessary to properly pad out the indices.
All the Morse codes for the letters in this set end with .. [AJKMOQT-Y] $&- All the Morse codes for the letters in this set end with -. T`L`\EDKN_UMS\EWNRTTMWGAI_ISADKG Replace each letter with the letter whose Morse code is the prefix of that letter (here E and T are simply deleted via the unescaped _, but normally they would be turned into ...
Otherwise we check each word w in the dictionary d, translate it into morse code C and, if the remaining code i starts with C, we add the word w to the translated beginning b and call the function s recursively on the remainder.
The current global accumulated result is the definitive value. This is tranformed into Morse digits and displayed. Detailed explanation 5:t!< % first half of the 10x5 array of Morse digits, with 0 for - and 1 for . t~v % vertically concat second half, i.e. first half vertically flipped 45+cXI % transform 0 1 to chars - .
Spaces replacing the first three pieces, the Morse code with a -suffix, the second half of the remaining letters; The new lines follow the same format as the existing line, just with an extra Morse prefix and half as many letters remaining to process. This is then repeated until each line has only one letter. _ [single space]
The code must define a function s(x) which returns the answer. The function must accept a string or character array (whichever is the "string of characters" type of your relevant language) with 81 Morse code numbers (see above) separated by spaces. Each 9 Morse code numbers is one row of the sudoku puzzle. Known numbers should be represented by ...
For digits, the number of spokes is reduced to the ASCII code mod 6, and it is assumed that all spaces are lines with the constant 728. BBC BASIC FOR loops are always excecuted at least once, so where the ASCII code mod 6 is zero, the plotting of the first spoke is suppressed by subtracting 1 from the constant.
The code works in two phases: First, it replaces each run of 5 binary digits with the corresponding two characters (letter and figure) from a lookup table. The lookup table is in the format 𝟎𝟎𝟎𝟎𝟎𝐋𝐅𝟎𝟎𝟎𝟎𝟎𝐋𝐅… where 𝟎 is a binary digit and 𝐋 and 𝐅 are the corresponding letter and figure ...