Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

It's been a while since I've done this stuff... but would it be possible to have a simple scrambler where let's say you type a certain text in the textbox (stesnu) and then hit a button or so and it can display possible words in another text box. So type in stesnu hit button then unscrambles the letters and displays possible words (sunset)? Is there already an app somebody made for source code I can use(where can I find it?)? I have a text file with a word in each line maybe it can use that as a data source. How would I go about doing this? Thanks. :)

 

~whosy

Posted

My guess is youwould need a list (text file) of words. They are around, just have to find them. I had one for uni a while ago.

 

Then just search each word for matching letters. You might want to read in the text file first of all and then split it up into arrays for different size words.

 

words2() '2 letter words

words3() '3 letter words

words4() '4 letter words

 

Doing this may speed up matching words when you want to unscramble them. But then again, it may slow your app down when you load it because you have to split the master list up into the various arrays.

Posted (edited)

Thanks for reply but I don't know how I would go about making it search for matching letters and splitting into arrays. Please help, thanks. BTW, this is in VB 2003.NET

 

~whosy

Edited by whosyodaddy
Posted
wot about makin it so there is 10 seperate lists of words, like 1 list is for 2 letter words, anther for 3 letter words etc, this would then be faster for program to load in, then you could have the program search through the list till it finds a word that uses all the letters of the scrambled word
Posted

I have done something like this before for a game called word whomp. Bascially it give you a bunch of letters and asked you to create as many words as you could in a certain amount of time. The words were between 3 and 9 letters, I think.

 

What I did:

 

I scoured the internet for wordlists. I found tons of wordlists everything from dictionaries to star trek terms. I wrote some code that took all the lists and cleaned them up and put them into one large file. From there I wrote a routine that went through and removed any duplicate entries. I ended up with a master wordlist of approximately 250 000 words. The next step was to sort the wordlist in to alphabetical order. This is important if you want to do a binary search on the list.

 

The grunt work is over. No the fun begins. What I did was take the entered letters and fill a collection with strings of all the possible 2 letter permutations, 3 letter permutations, 4 letter permutations etc. I iterated through the collection checking to see if each permutation exists in the wordlist. If I find a word, I added it a "valid word" collection. In the end I had a list of words that matched something in the dictionary.

 

The program ran really quickly.

Posted
Fenris' date=' do u still have this wordlist? If so can u share it with us pls?[/quote']

 

I'll have to look on my home machine for it. If I find it I'll post it as soon as I can, probably saturday.

Posted

Here is the sorted word list. There are approximately 71242 words. The words were compiled from many different sources.

 

I have all of the word lists that I used to compile this list. If you are interested I could email it to you as it is a 4 MB zip file.

 

Hope this helps!

SortedWords (71242 words) .zip

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...