FreeRice.com and Automaton
I had recently become aware of a website named FreeRice.com. This site provides a vocabulary game where one identifies synonyms for words with an ever increasing difficulty. Since I could always use a better vocabulary the site intrigued me. I played the game for a few hours but was in no way satisfied with my progress. At roughly one correct answer every two seconds I’d rank up 18,000 grains of rice an hour. Unfortunately, once I reached the higher levels I was averaging only 3 out of every 4 questions right.
While 13,500 (75% of my estimated optimal efficiency) grains of rice is a lot, it was nowhere near satisfactory. After joking about my “horrible rice metrics” at work, I mused that I should write a Greasemonkey script which would play the game better than I could possibly hope to. As the rest of my work day rolled on I became more and more intrigued by the idea. There was absolutely no reason why I couldn’t write a very simple AI to play the FreeRice.com game.
Were there reasons why I shouldn’t?
I knew the most obvious reason:
This wasn’t a controlled experiment. If the script spun out of control and was allowed to play over and over I could risk exhausting FreeRice.com’s funds.
Because I didn’t want to be responsible for the downfall of a potentially lucrative source of food for impoverished children I initially abandoned my bot. Despite my fears, curiosity eventually got the best of me and I began implementing my bot. I started by implementing a simple timing method limiting page requests to once every 10 seconds for debugging purposes, just in case.
Flash forward a day or so and I had a working FreeRice.com bot named “Automarice”. The bot had a number of interesting features which I found fun. First and foremost the bot kept statistics on its “correctness” per level it visited. These statistics were provided both over every answer given for a single level, as well as for the last hundred answers. These answers were provided as a simple HTML table benieth the FreeRice.com advertisements.
The AI behind Automarice was simplistic at best. I have no formal training in Artificial Intelligence and as such I just tried to make the bot behave as I would. To implement the AI the bot was given a few things. First, the bot was given a dictionary which it could use to store words and definitions. Second, the bot was set to record the associations it remembered learning from playing the game. In this way the bot was given a “memory” of previous correct answers. The bot started out with random play. If the bot was unsure of the answer it would select one answer at random, and would record the result. In this way the bot would slowly build a large vocabulary and increase its level.
The algorithm was improved on slightly by allowing the bot to reduce it’s probable correct answer set by excluding potential answers which it already knew that did not match the given question word. This did introduce incorrect answers when new synonyms were learned, but since it improved the general case it was considered a good thing. The thought process of the bot was identified in the UI by striking through answers it believed were incorrect, and underlining the answer it would chose. If the answer was a guess it would append a question mark to that answer.
Finally, I implemented a dictionary and statistics exporter and importer. An export would generate an HTML page containing JSON representations of the internal dictionary and statistics. When this export file was opened it would trigger Automarice to import the data.
My bot contained a number of functional bugs. For example, if both the bot and the user played at the same time, the bot would produce script errors. However, since my bot was able to play the game successfully these errors didn’t really bother me.
After reducing the wait time from 10 seconds to a random number between 2 to 10 seconds per question I let my bot go for a few hours. After my bot gained an accuracy of 78% on level one, it looked like it would gain 1 or 2 levels every hour or so.
Satisfied with my progress I retired my bot. While I am interested in releasing the source code I do not want to provide a plug and play method for taking down FreeRice.com. As such the source code will remain locked up.







November 22nd, 2007 at 9:02 pm
the rice thingy is so cool and so is the site
May 15th, 2008 at 1:13 am
I honestly think it’s stupid of you not to release it. Just so you know, a lot of other bots exist, you keeping yours to yourself doesn’t feed anyone.
May 15th, 2008 at 7:41 am
That’s fair of you to say.
However, by your own admission there are other bots out there that people can use to game the site. If they really want to there’s nothing stopping them.
I agree with the site’s policies on automated playing. If nobody views the ads, no money is generated. If the sponsors feel they aren’t making any actual advertising impressions from the site then they won’t sponsor. With no sponsors there isn’t any money for the rice in the first place. How would that feed anyone?
If FreeRice.com changes their position on bots I will release mine.
Until then I’ll respect FreeRice.com’s wishes.
August 26th, 2008 at 1:56 pm
It’s cool that you built a bot that could answer the questions reasonably well. It’s in interesting problem to solve.
I think people have trouble understanding that it’s not actually answering the questions that generates any money for rice, but the advertisements on the site. If a bot randomly clicks on links it’s not going to do anyone any good. It doesn’t magically generate rice somehow.
There are some new charity game websites out there now. Charitii.com (interesting crossword questions for free water), Aidtochildren.com. What do you guys think about these new charity sites coming out?
August 26th, 2008 at 5:24 pm
@Jessica
Thanks for the compliment. It definitely was a fun little thing to write.
I’m surprised by the number of people who do not seem to read the Freerice.com FAQ.
It is indeed advertising impressions that pay for the donations you make by playing.
I can’t help but worry that increased botting will shake the advertiser’s faith in the site as an advertizing tool and cause them to pull out.
After all, what’s the point of paying for advertising if the only people “seeing” your adds are bots.