Words With Friends AI

I ran across a game called “Words With Friends” these days on the IPhone.  It is very fun to play.  After playing several games, being a computer scientist, I automatically think about developing and artificial intelligence program for the game.   It is pretty challenging as there are a lot of words, and so many possible combinations to check, and for different directions.  I first implemented an exhaustive search, testing every word in the dictionary for every cell.   The result was miserable, one hour goes by and the computer only tested 20% of the words.

Admitted I was stomped.  There has to be a better way.  I have to add heuristics to the search algorithm.  So I mapped out an efficient and clear thought process, and implemented it again.  This time the results are better, took 10 minutes to go through all the words.  Of course, in computer science there are ways to cut processing time with increase in the use of memory.  So after a couple hacks, it can run on reasonable times.

Testing the AI against some opponents, I  kept on improving it with some simple strategies such as sacrificing points to reduce exposure to Double or Triple risks.  I think the AI is pretty good now.  I must say it was a fun project.

Click Here to use my Words With Friends Cheat

26 thoughts on “Words With Friends AI”

  1. Bubu Candelario says:

    This works great, the words are superb. Thanks

  2. cARRIEPENNOCK says:


  3. admin says:

    Yes you can, just put three different game id’s.

  4. Me says:

    Is there a way to enter in the blank tile that can be used for any letter?

  5. carrie says:

    what do you put in the letter catagory if you have a blank tile?

  6. admin says:

    blank tiles carry no points, so you can put common letters in place of the blank tile to increase the number of possible words.

    My favorite is just putting any of the vowels. a, e, i, o, or u.

  7. Q-jmpr says:

    That’s a cool hack, but I thought that’s what Words With Friends used for “random opponent” when it first came on-line/ couldn’t FIND random opponent? Right?

  8. Chef J says:

    This is awesome. It is really helping me to learn new words, and help with my dislexia! Thank you!

  9. Lisa says:

    great website. the one thing i would suggest is to add the points total.

  10. Laura says:

    Thank you! really thank you you have done humanity or in this case MY EGO heheh a great good, since my native language is Spanish, my english words maybe limited and my friends were just beating me in this game thanks to you … well… I can “pretend” I am good with. It works really great!

  11. James Madison says:

    It seems to have a major bug. I told it I have the letters “fzriuee” and it told me to spell “freeze” entirely out of my letters where one of the “e”s extended a word already on the board. The problem is I don’t have enough “e”s to spell that word.

  12. Winner says:

    Cheaters never prosper.

  13. Tara colgan says:

    Want to play, please no cheaters.. frndslover

  14. laduke says:

    How do you determine what words to use at the different skill levels? Do you have separate word lists? Or do you use an algorithm to determine that?

  15. Xaiier says:

    This is so cool!

    I was wondering, would you be willing to share some of the tricks you used to make this work? I’m also a bit of a programmer and I also thought of doing something like this but I’m a little lost on something this complex. Trying to replicate the processes of the human mind are quite difficult. :S

  16. phil says:

    The comments on your Words with friends” site should be titled “rawest, most disgusting, gay porn blog” I have ever seen. There should be some way to report or “mute” this garbage!

  17. Alx says:

    Hi, I am a CS major as well. I would love to see your algorithm, do you have plans to share the source code?


  18. Michael says:

    Since you can’t comment directly on it, I thought I’d mention here that the “Words With Friend Dictionary” that you have a link to here is nothing of the sort.

    First of all, it has numerous words that exceed 15 letters in length, and there’s absolutely no reason the production Words With Friends word list would contain them.

    While I agree it’s a nice list, it is not “the word list used by the actual game” as you state.

  19. daBoss says:

    Nice work. It would be funny if the saved game’s could detect the another game with the exact same letters. If your opponent was also using this tool, it could tell you. I like to ‘play’ the game, but this dude at work is just kicking my butt. I wonder if he is using this?

  20. Shane says:

    Looks like you got hacked, dude. You might want to tighten up things around here.

    document.forms[0].assets.value = ‘cheaters never prosper’;
    document.getElementById(“username”).disabled = true;

  21. Kathie says:

    This was totally amazing, and I have had a LOT of fun pretending to be a genius. However, today it no longer works. My games will not load, there are the words “cheaters never win” in the space where you are supposed to put your tiles, I cannot post a comment, etc. I really hope we don’t lose this wonderful site and that this can be fixed. You are awesome and a genius for real in any case!

  22. JAMES TAYLOR says:



  23. JAMES TAYLOR says:

    Still need some help from the administer. Game list is getting really long and it is getting harder to find the game that I need. I have changed my method of naming games to a different format:
    Month Day Hour:Minute Opponent Name (All CAPS). We just need a way of deleting expired games to clean up the list. If anyone else agreesm please let the administrater know.

    James Taylor

  24. S says:

    While this works with “Word Feud”, it doesn’t take into account the bonus tile arrangements. Have you considered trying to write a version to include board bonus tile selections? Sounds a bit more complicated! 🙂

  25. Michael says:

    This site works great. Have been getting stomped by a cheater forever. Stumbled on this and your site has been staying a solid 100 points ahead of them. I’m sure random letters affect the results some, but nice work none the less! Easy to use, quick response time and nice simple functionality. Thanks for tinkering!

  26. nina says:

    You may want to fix the save game option. I can put in any name and mess with their board. Booyah

Leave a Reply

Your email address will not be published. Required fields are marked *