uscommands into one in such a way that it will always automatically generate all possible "surprise answers" in cases such as Example 3 below without the user having to do the intermediate steps manually.
source compile(and hit Enter).
spellwhich may not be installed on your Linux distribution by default. Its
owcommand also uses the
sedutilities. You can use e.g. your package manager to install them if any of these are missing on your system.
us(unscramble a single word),
ow(one word at a time of a scrambled group of words). Entering each command without any arguments will produce a short description of how to use them.
uswill produce all other words consisting of the same letters. It's somewhat surprising to see how few different words share the same letters - definitely far fewer than is the number of the available theoretical permutations of the given letters.
> us acome comae cameo > us feroc force > us reddeg dredge > us yurfip purify > us ercdepi piercedThe text after the prompt > is the command entered, and the next line contains the code's response. The single argument of
usis the scrambled word from each line of the Jumble above. The first use of
usshows a relatively rare case when
usfound two words, comae and cameo, and the user has to decide which one the author of the Jumble had in mind (or simply try both in turn). Because the "surprise answer" in this case is also one word, we can can again use
usacting on the sequence of letters copied from the circled cells of the jumble.
> us jegud judge > us emich chime > us nexett extent > us cavide advice > mus gehittae 5 eight tea eight ate eight eta eight eat tithe ageHere the "surprise answer" consists of two words, and so we had to use
mus. It's first argument is again the string of letters collected from the circled cells, and the second argument is the length of the first word.
muscan be used for an arbitrary number of words, and one does not have to give the length of the last word (see example 4 below). Here
musreturned five solutions, and of these the obvious choice that corresponds to the cartoon is "eight ate".
> us lyshy shyly > us gobef befog > us slatte latest > us rupple pulper purple > ow hlybeglasul 5 ables abuse alley bagel bales balls beaus belay bells belly blahs blase blues blush bugle bulge bulgy bulls bully bushy egaly ellly gable gales galls glues gluey gsaly gulls gully gushy gybes hales halls hauls heals hells hulas hulls label laugh leash legal lubes lulls sable sally sealy shale shall shell sully usage usely yeahs yells > us hlgasu laughsWhen the number of letters in the first argument of
musexceeds 10, the execution time starts to grow significantly with the number of letters (partly because the code uses recursive functions). Here I at first tried
msu hlybeglasul 5as in the previous example, but it was soon obvious that the code will take some time to produce a solution. So I killed it for now, and tried the other approach recorded above using
ow. In mere 15 seconds it spitted out the above list of 56 words (one on a line, but I rearranged them as above to save space). These are all English dictionary words that are five letters long and their letters are all in the string 'hlybeglasul'. The only word from this list that has an obvious relation to the cartoon in this Jumble (to the "abdominal surgeon") is the word "belly". So I next tried to find its companion word using
us hlgasu. Here 'hlgasu' was obtained by removing from 'hlybeglasul' all the letters that were already contained in "belly". It worked, and gave right away the solution of this puzzle as "belly laughs". All this was achieved in less than two minutes.
muswould come up with in this case. It was:
> mus hlybeglasul 5 belly laughs balls hugely bagel lushly blush galley gable lushly glues blahlySo "belly laughs" is really the only relevant solution in this case. But I had to wait 41 minutes for
musto finish its work (on a 2.4GHz computer). The code does not give out any indication that it continues to work, other than occasionally printing out a match with possibly very long intervals in between. There is no potential for infinite loops in the code, so if you have time to wait, be patient and do not kill the program prematurely, unless you are of course sure that one of the already printed matches (such as the first one above, "belly laughs") is the correct solution of the puzzle.
ow, to try to get individual words of the solution one at a time. This can be quite fast even if it is sometimes necessary to try more than one word from the initial output of
> us litte title > us ockal cloak > us nickes sicken > us tifful fitful > mus tiokckitu 4 3 kick out ti kick out itThis is a straightforward application of
musto the case of the final answer consisting of three words of 4, 3 and 2 letters, respectively. Again, the length of the last word need not be given as it can be determined from the number of letters in 'tiokckitu' (9-4-3=2). The correct solution: a "kick out" of "it". Titanium (Ti or ti) of the first match returned above by
musis obviously not related in any way to our cartoon.
> mus rasrupesog 4 rasp grouse rasp rogues rasp rouges raps grouse raps rogues raps rouges rags poseur rugs operas rope sugars ares groups spar rogues spar rouges spar grouse spur reagos sera groups sear groups soar spurge soar purges sour pagers sour grapes sour gasper sops arguer sags pourer sago purser pore sugars pour regsas pour gasser pour gsaers pros augers pros argues pars grouse pars rogues pars rouges pugs soarer eras groups ears groups euro grasps oars spurge oars purges ours pagers ours grapes ours gasper gasp rouser gasp sourer gaps sourer gaps rouser
|The already well illustrated initial single-word unscrambling phase is omitted here.|
This is an example when |
spellutility does not recognize proper names as valid words if their first letter is not capitalized (the only exception to this rule that I have found so far is "england"). It has no problems with all letters of any word being capitalized (or when only the first letter of any valid word is capitalized as expected in the beginning of sentences or in titles). Therefore, one gets more valid words when all letters are entered in upper case. Never use mixed case for a scrambled word, unless you know in advance which letter is the first one in the unscrambled word. A few examples for illustration:
> us belgium > us Belgium Belgium > us elgiumB Belgium > us Elgiumb > us BELGIUM BELGIUM > us Italy Italy > us italy laity > us ITALY ITALY LAITY > us robert > us Robert Robert > us stop stop spot tops opts post pots > us sTop Tops > us Stop Stop Spot > us STOP STOP SPOT TOPS OPTS POST POTS(A missing response line from
usof course means no match.)