|
[code] StreamReader textFile = new StreamReader("WordList.txt"); StreamWriter write = new StreamWriter("List3.txt", false); do { string text = textFile.ReadLine(); if (text.Length == 3) write.WriteLine(text); } while (!textFile.EndOfStream); MessageBox.Show("done"); [code]
There is a game on face book called scramble (also known as boggle) where you have a 3x3 or 4x4 grid of letters and have to find the words in the grid ranging from 3 to 8 letters.
I have made a program that will find the words. my only problem is that it is really slow because the word list that it checks from is extremely long. So I want to make the word list into many different lists sorted by number of letters.
I have created such a program with the code above. The code works perfectly and fast. My only problem is that when the program writes so many words it just stops writing. For instance when I tried to put all of the 3 letter words in a file it got down to the word "tat" after that it wont write any more to the file. I have tried debugging it and it looks like it should keep writing it just doesn't. I already tried doing it in two lists but it only adds a few more words not all of them. I think it might be a memory overload problem but I'm not sure how to fix it.
|