Sunday, June 3, 2012

Before the Machine there was...

Before there was ever a machine that would except the code that I sent it there had to be some mechanism to actual compute the possible paths that could combine the letters to make words.

Lucky for me there are multiple sources for databases of potential 3, 4, 5 & 6 letter words thanks to the community that is obsessed with Scrabble . Once I had a comprehensive list it was a matter of building a spreadsheet in MS Excel that could do two things. The first, as I mentioned, would be to calculate all the potential paths according to the rules of Wordament - basically that the letters had to touch each other and you could not reverse. This was where I eventually started: labeling the 'cells' and writing an formula (for another post) that could figure this out for me.
I'm no mathematics expert, so I'm sure I took the long road, but once I had the concept down, it all when pretty fast and now I have data for up to 7 letter words, which, for the way my excel model is set-up, is pretty much the limit (even for a 4 core Intel i5 processor) I could match during the 2 minute Wordament game window.

So, just real quick - to the right are the potential combination from position 1 - 11 in total. All said an done, for each position, there comes out to be around 400 (408 to be exact) potential paths to create a 3 letter word, starting from each position. Again, I'm sure there is a formula out there to compute the potential outcomes, but I needed to know EVERY outcome.

The second step was to match the potential paths to the actual words during each round. This is essentially just a big VLOOKUP that makes its way into a PivotTable to weed out the blank values and sort by a theoretical total point value.

I'll be going into each of these steps in much greater detail, but I wanted to layout the big concept of the calculation that eventually is turned into GCODE for the CNC GRBL shield to recognize. It is great fun - hope you'll join me as I document my process.

No comments:

Post a Comment