This is a little snippet i made. You can A) scramble a string, and B) unscramble a string(as long as it's one word). If there is more than one way to unjumble a word, it will show all possibilities. Also the unscrambler only unscrambles words, so don't expect it to unscramble a name (unless it's in the wordlist).
For this snippet to work, download this text file to the same directory as the snippet.
http://luke.dbspot.com/files/allwords.txt
sync on
sync rate 0
randomize timer()
cls
sync
global word_amount=109585
dim word$(word_amount)
dim letter(26)
dim letter_temp(26)
dim temp_list$(0)
dim result$(0)
global alphabet$="abcdefghijklmnopqrstuvwxyz"
print "Loading every word in the english language, one moment please..."
sync
open to read 1,"allwords.txt"
n=0
repeat
inc n
read string 1,word$(n)
until file end(1)=1
close file 1
top01:
cls
sync
print "Word Scrambler"
print "[1]Scramble a Word"
print "[2]Unscramble a Word"
input n
if n<1 or n>2 then goto top01
input "Enter the string: ",string$
if n=1
string$=scramble(string$)
print string$
sync
wait key
endif
if n=2
string$=unscramble(string$)
endif
goto top01
function scramble(s$)
length=len(s$)
dim char$(length)
dim flag(length)
for n=1 to length
char$(n)=mid$(s$,n)
flag(n)=0
next n
string1$=""
for l=1 to length
repeat
n=rnd(length-1)+1
until flag(n)=0
flag(n)=1
string1$=string1$+char$(n)
next l
undim char$()
undim flag()
endfunction string1$
function unscramble(s$)
empty array temp_list$(0)
empty array result$(0)
length=len(s$)
for a=1 to 26
letter(a)=0
next a
for n=1 to length
for a=1 to 26
if upper$(mid$(s$,n))=upper$(mid$(alphabet$,a))
letter(a)=letter(a)+1
endif
next a
next n
for n=1 to word_amount
if len(word$(n))=length
array insert at bottom temp_list$(0)
temp_list$(array count(temp_list$(0)))=word$(n)
endif
next n
count=array count(temp_list$(0))
true=0
for n=1 to count
if match(n)=1
array insert at bottom result$(0)
result$(array count(result$(0)))=temp_list$(n)
inc true
endif
next n
if true=0
print "Word cannot be unscrambled"
else
if true=1
print "The answer is ",result$(0)
else
print "The word can be unscrambled in the following ways:"
for n=0 to array count(result$(0))
print result$(n)
next n
endif
endif
sync
wait key
endfunction s$
function match(num)
for a=1 to 26
letter_temp(a)=0
next a
s$=temp_list$(num)
length=len(s$)
for n=1 to length
for a=1 to 26
if upper$(mid$(s$,n))=upper$(mid$(alphabet$,a))
letter_temp(a)=letter_temp(a)+1
endif
next a
next n
m=1
for a=1 to 26
if letter(a)<>letter_temp(a) then m=0
next a
endfunction m
-----------------------------------
To delete the bug, delete the code.
Specs: Sony VAIO Laptop, Windows XP, P4 2.8Ghz, 512MB RAM, ATI Radeon 64MB video memory, DBP Upgrade 5.3.