Anagram generator: Difference between revisions
m
Automated syntax highlighting fixup (second round - minor fixes)
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
Thundergnat (talk | contribs) m (Automated syntax highlighting fixup (second round - minor fixes)) |
||
Line 34:
Implementation:
<syntaxhighlight lang=
seed=. (tolower y)([-.-.)a.{~97+i.26
letters=. ~.seed
Line 65:
Examples:
<syntaxhighlight lang=
cetera stood
coat oersted
Line 138:
=={{header|Julia}}==
<syntaxhighlight lang="ruby">const unixwords = split(read("unixdict.txt", String) |> lowercase, r"\s+")
function findphrases(anastring::AbstractString, choices, sizelong = 4, n_shortpermitted = 1)
Line 210:
=={{header|Phix}}==
Couldn't really think of a better way than just building a dirty great filter list to get rid of the less interesting answers....
<!--<syntaxhighlight lang=
<span style="color: #008080;">with</span> <span style="color: #008080;">javascript_semantics</span>
<span style="color: #008080;">constant</span> <span style="color: #000000;">bo_ring</span> <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">{</span><span style="color: #008000;">"al"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"alex"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"am"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"an"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"and"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"anent"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"ann"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"ant"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"ar"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"ares"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"art"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"at"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"ax"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"axle"</span><span style="color: #0000FF;">,</span>
Line 318:
Using the unixdict.txt word file by default.
<syntaxhighlight lang=
say 'Enter a word or phrase to be anagramed. (Loading dictionary)' unless $in.chars;
Line 382:
Alternatives formed by simply changing the order of the two words have been suppressed.
<syntaxhighlight lang="ecmascript">import "io" for File
import "./str" for Str, Char
import "./perm" for Comb
|