Connect Four made with minimax

This is another fun python project I made myself in spare time. It’s simple connect four game made, where I studied mini max algorithm with α-β pruning. I admit that it took me a while to figure out the idea behind mini max, but when I did, it was quite simple to code. To bad I did it in python since it’s slow. Because of my expensive heuristic function I could reach only depth of 5 for minimax. Well, it’s possible to go deeper, but the game becomes un-playable because of slow response time.spet sem izgubil sam proti sebi

Bot is quite strong, but anyone determined enough can beat it. If I would switch language from python to something like C#, I could make really faster -> stronger. But it’s ok, I have learned a lot!

Oh, also I like to do “dynamic” stuff so I can play connect four in any size I want.

This is my face when I lost against myself (I am green and bot is red)the bot beat me again

This is where I won against the bot – the proof that bot was too weak :(. But I was scared that my own code outsmarted me so of course I needed to beat the bot! Well, it didn’t outsmarted me, yeah!

koncno sem premagal


About Vili Volčini

Programming is art! I have been programming since 14 years and I have big interest into video games, electronics and robotics. Currently I am studying at math university FMF and as a side projects I am working on video games. Someday I will build a real robot with intention of helping humanity, but it's long road to there!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: