How I build this project: It was mid-2013 when I wanted to apply what I've learned from the MOOC CS188.1x Artificial Intelligence offered at edx.org. Around December 2013, I joined a bootcamp held in my university (Nanyang Technological University, Singapore) in which some of the speaker came from Mozilla. Here, I learned a lot of stuffs on JavaScript (they also introduced us to HN). Later, I thought of applying what I've learned to a game. I then started the project and finished it during January 2014.
Nice work! I was actually planning to do a similar project in the near future. However, it troubles me that I was able to win when your AI didn't "block" me when I put 3 aligned circles. Shouldn't that be the very first rule for such an AI?
Not to be a pessimist, but Connect Four is a solved problem: http://en.wikipedia.org/wiki/Connect_Four Wouldn't that mean the best AI should always win if it's first (alternatively, you should always win if you're first)?
I'm aware of the fact that this is a solved problem. When I experimented by making it my AI vs my AI, it did not use the optimal first move. This shows that my AI is not perfect :)
34 comments
[ 3.3 ms ] story [ 93.4 ms ] threadThe next offering is starting soon:
https://www.edx.org/course/artificial-intelligence-uc-berkel...
I also expect to build some of these at http://ai-maker.com/
Thanks for sharing it and congratulations!
Edit --
Github is here: https://github.com/RyanMarcus/connect4
Looks like my AI beats your AI. ;)
For instance, on your first go, drop in column 0. Then, the AI drops in columns 1, 2, 3, 4, leading to this:
After trying it now, the AI actually tries harder to beat you, and my previous method is not effective anymore.
It's really a great game for playing with AI strategies since it's so simple. You can borrow our game runner and write your own: https://github.com/smilliken/aigames/tree/master/connect-fou...
You can use any language since it just talks over pipes. There's a few bots in there you can play against.