Killbat shouldn't write any code ever again: Here's to ruining scrambled word games!

Killbat

Diamond Member
Jan 9, 2000
6,641
1
0
I have to confess. I was cheating in the word scramble thread; I wrote this little utility to solve the scrambled words for me.
It's relatively fast, able to solve most on my machine in well under a second.
I'm passing it around here to ruin future word scramble games by introducing the possibility of cheating.
So... here ya go! :D
http://www.umr.edu/~mezd36/descram.rar
http://www.umr.edu/~mezd36/descram.zip

EDIT: Forgot to mention, the dictionary is the wordlists from a bunch of games (like Scrabble) merged together. It's almost 9MB. :)
If words come up as a match more than once, it's because they're in the wordlist more than once.
 

ScottyB

Diamond Member
Jan 28, 2002
6,677
1
0
How do I open it, I have never heared of a .rar extention. Is that for linux?
 

gopunk

Lifer
Jul 7, 2001
29,239
2
0


<< How do I open it, I have never heared of a .rar extention. Is that for linux? >>



i'm not sure if winzip can do it, but if not, winrar is a good program to use.
 

minendo

Elite Member
Aug 31, 2001
35,560
22
81


<< How do I open it, I have never heared of a .rar extention. Is that for linux? >>


winRar
 

crab

Diamond Member
Jan 29, 2001
7,330
19
81
! D:\Downloads\descram.rar: Unknown method in descram.exe
! D:\Downloads\descram.rar: Unknown method in words.txt
! D:\Downloads\descram.rar: Unknown method in descram.cpp
! D:\Downloads\descram.rar: No files to extract
 
Jun 18, 2000
11,212
778
126
Hmmm the rar doesn't seem to be working for me either. I can't extract or open any of the files in the archive. I'm using WinRar 2.8 if that means anything...
 

EvilYoda

Lifer
Apr 1, 2001
21,198
9
81
cool beans, I'm gonna go through you code. doh, I'm on the family computer, it'll have to wait til the weekend.
 

Amused

Elite Member
Apr 14, 2001
57,453
19,913
146


<< I have to confess. I was cheating in the word scramble thread; I wrote this little utility to solve the scrambled words for me.
It's relatively fast, able to solve most on my machine in well under a second.
I'm passing it around here to ruin future word scramble games by introducing the possibility of cheating.
So... here ya go! :D
http://www.umr.edu/~mezd36/descram.rar
http://www.umr.edu/~mezd36/descram.zip

EDIT: Forgot to mention, the dictionary is the wordlists from a bunch of games (like Scrabble) merged together. It's almost 9MB. :)
If words come up as a match more than once, it's because they're in the wordlist more than once.
>>



Nifty, but there are many websites that perform this function as well.

Here's the first I found: UNSCRAMBLER

True genius is not doing superfluous work. :D
 

yllus

Elite Member & Lifer
Aug 20, 2000
20,577
432
126
I am most impressed, young Padawan. :D Care to go over your basic scrambled word to deciphered word algorithm with us? I have a few ideas spinning around in my head already but would like to hear what you came up with. :)
 

Killbat

Diamond Member
Jan 9, 2000
6,641
1
0
"I like the system requirements: 87,660k."

Yea, ain't it great? :D ;)
I used to just read straight from the file (very tiny RAM required), but this way is much faster.

edit: from the code:
/*
The solving technique is thus:
1) access next word in dictionary list
2) if the puzzle word is the same length as the dictionary word, proceed.
otherwise, go back to 1
3) go through the dictionary word letter-by-letter
is the letter in the puzzle word, unused?
if so, mark the letter in the puzzle word as used, and go to the next letter
if not, go back to 1
4) if all letters have counterparts, report a match, then go back to 1 until all words are checked
*/
 

yllus

Elite Member & Lifer
Aug 20, 2000
20,577
432
126
That's exactly how I figured it too, isolate each word of the correct length and do a substring match character by character afterwards. Good stuff. :)