New games every week!
Wordlist Upgrade Blog
23rd September 2018
A minor update to the way Word Ladder is generated, which has sped the whole thing up by a remarkable amount.
What took about 3 or 4 seconds, yesterday, now only takes around 0.2 seconds.
Optimisation is the key!

Technically, instead of checking each and every word in the list, I first ensured the wordlist was properly alphabetised..
Next I jump through the list in groups of 1500 words, until "over", then do a quick sift between the 1500 chunk of words.

This is the "Normal" way to do wordlists, but something I've avoided in the past due to Wildcard functionality. eg, If the word you're looking for is "?abbage", how do you know where to stop?

In case I need wildcard functionality in future, I've left the old code available, but even that could do with some neatening around the edges, possibly converting everything to numbers.. Hmm..
Views 57, Upvotes 15  
Foldapuz Blog
New games every week!
Site credits : Site built from the ground up, in php, using Programmer's Notepad 2, and a very bored Jayenkai.
(c) Jayenkai 2023 and onwards, RSS feed 4

Blog - Wordlist Upgrade - AGameAWeek