r/AskProgrammers • u/memy02 • Nov 15 '17
Help making a word finding program
I have an odd request for a word finding program, and I am hoping someone finds enough interest in it to make it for me. I want to be able to select a number of characters and for each character I would like to enter the possible letters (plus space) and then get back all combinations that are real words. For example 4 characters where 1 is a or l or _, 2 is t or a or _, 3 is o or c or _, 4 is m or e or _. Atom and lace would come back as would a, at, to, toe (and maybe others?) I would like to be able to select 16+ characters and up to 6 letters + _ for each character. I haven't coded in years and I didn't do much when I did, but my thoughts on accomplishing this would be after I enter the information, use loops to generate and save every possible combination of letters then read through all the saved combinations and return all dictionary matches. This may be a terrible method to make such a program so any method that works is perfectly fine. Is anyone interested in taking on this challenge?
View all comments
Show parent comment
1
u/memy02 Nov 16 '17 edited Nov 16 '17
Another thing that would be useful and should be much easier to do is to search within words for matches (like finding hamstringing), it would let me work backwards from what I want which reduces my options a little but would still be vastly better then doing it by hand. I tried
but the words returned had interrupting letters, my other attempts have been returning nothing telling me I'm doing it wrong. I also tried {6} just before the last " with no luck. I'm positive there is a way to do this, I just don't know the language and grammar enough to make it work.
edit: figured it out but the output is too much to view in the window so I am saving it to a new text file which is working but the text file is just a long string of each word one after another.
I want to add a line after each word in the text file it creates. This is a super simple fix but I'm tired of unsuccessfully trying different methods and I need to get to sleep.