Crossword Helper

Share your advanced PureBasic knowledge/code with the community.
collectordave
Addict
Addict
Posts: 1309
Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal

Crossword Helper

Post by collectordave »

Suggested I use regular Expressions to search text but I did not have a clue so tried learning.

Made this programme to help with crosswords.

When run type in the letters you have using question marks for letters you do not know. Then click the get Words button and the list will be filled with words that match.

Just cannot get a regex to match the length of the word as well so just use len() on first pass.

This includes an English dictionary file not complete but seems quite big enough. This is just a list of words in a file.

You can get all the code and dictionary here. https://www.mediafire.com/file/iy96p6pv ... p.zip/file

CD

PS Think I found the length bit

replace line 38 with

Code: Select all

RegEx = "^" + Word  + "$"
and you can do away with checking the length,

CD
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
ebs
Enthusiast
Enthusiast
Posts: 530
Joined: Fri Apr 25, 2003 11:08 pm

Re: Crossword Helper

Post by ebs »

Very nice - simple and quick!

I'm going to try to adapt it to another kind of word puzzle.
This one gives you a word and you try make as many words as you can using the letters from the original word.

Regards,
Eric
Post Reply