Jump to content

Anagrams: Difference between revisions

487 bytes added ,  15 years ago
+ AutoHotkey
(+ AutoHotkey)
Line 83:
evil,levi,live,veil,vile
</pre>
=={{header|AutoHotkey}}==
contributed by Laszlo on the ahk [http://www.autohotkey.com/forum/post-276367.html#276367 forum]
<lang AutoHotkey>
MsgBox % anagrams("able")
 
anagrams(word) {
Static dict
IfEqual dict,, FileRead dict, unixdict.txt ; file in the script directory
w := sort(word)
Loop Parse, dict, `n, `r
If (w = sort(A_LoopField))
t .= A_LoopField "`n"
Return t
}
 
sort(word) {
a := RegExReplace(word,".","$0`n")
Sort a
Return a
}</lang>
 
=={{header|C++}}==
<lang cpp>#include <iostream>
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.