Tag Archives: python

WordBrain solver – 4×4 – Semi-Brute-Force

This is my solution so far, for semi-brute-force solving of 4×4 WordBrain puzzles.

This program will find all possible valid words found in a norwegian dictionary. This will take around ten minutes (on a 1.2Ghz MacBook). I have tried to implement skipping of a path-traveling if the first two letter does not exist in my dictionary.

I have one idea to make the program a little bit faster. I will make a new Python dict containing the first and last letter from all the words in a norwegian dictionary. This way, checking all possible paths from ‘t to ø’ is skipped, if I know that no norwegian words start with a ‘t’ and ends with an ‘ø’. That should shave some time of the implementation.

One problems shown above. The first run of the program checks every possible route from every letter to every other letter. When solving for the word JOKER above, the letters are rearranged and new paths are formed. Meaning the program have to be run again.

The first round is run with the letters: k1,e1,e2,r1,o1,r2,j,e3,e4,r3,o2,k2,ø,y,s,t

After JOKER rearranged the letters, we kan input the letters again, exchanging all the used letters with a letter not existing in that specific problem. Here we will use ‘x’: k1,e1,x1,x2,o1,r2,x3,x4,e3,r3,e4,x5,ø,y,s,t

This will take another 10 minutes, since we will look for unlikely paths like from ø to x.

The OSX Terminal output:

 

CONTROLLING UARM WITH SERIAL COMMAND THROUGH PYTHON WITH STDIN OVER BLUETOOTH FTDI DEVICE

I bough my uFactory uArm with an additional Bluetooth module.

I have had some problem making it work, so I will note down the procedure here.

The drivers for FTDI are found at FTDI Chip. I am using the x64 (64-bit) for Mac OS X 10.9 and above.

After installing the driver, the Bluetooth port did not come up in Arduino. I only get this error message:

Checking my System Information, I find the following information. (Description in Norwegian)

The available port can also be located with pySerial.

When using Python, I change the serial port to:

And then I follow the same procedure I did with the FTDI through USB cable. This works fine.