New Connect Four Game
Just updated my connect four game to using trap search, a hash table, and the added ability to learn from its own mistakes. This means that you cannot beat it the exact same way twice ever (unless you delete the hash file! :) )!
Its still console, I wanted to get it up and going before I spend the endless hours trying to make it into a mouse driven GUI.
The algorithm is a little different than the traditional algorithm for connect four which relies on alpha-beta pruning, but I wanted to see if I could come up with a different way. So far it plays very well and you'll be hard pressed to beat it. Unfortunately I haven't been able to find another connect four game that uses the traditional algorithm to play against mine to see how well it would do. All the ones I've found have different dimensions than my board.
Anyways enjoy! And if you have any comments, criticisms (except for complaints that its only console!), or whatever, I welcome them on this board! Also let me know how you fare, ie how often you beat it vs losing to it.
good game. the AI is very defensive. oh yeah, i wasnt sure what your quit command is so i typed "exit" and it sent the game into an infinite loop of output.... "where do you want to go" over and over.
Oops :) I included exiting the game and error checking for text at the last second, but accidentally uploaded the old version without it. When I get home tonight I'll upload the .exe that includes those!
Hehe, i've made a connect 4 game as well, not i didnt' spend much time on the ai. But im developing an othello game now, implementing minimax.
Your game ai is pretti good, as said. But....i think your computer thinks too slowly lol..
Yeah, unfortunately with since my algorithm relies so much on trap finding, there really isn't any way around having to check EVERY single move, which really bogs down the time it takes to think. The hash table helps out a little, but not as much as I had hoped for. How long was it taking to think? For me it takes about 20 seconds near the beginning, then picks up in the later stages of the game. But then again I have a fairly fast computer.
**sigh** I was hoping for a better way to do it than the traditional way, but maybe I should write it over with minamax using alpha beta pruning, and then have the two programs go against each other to see which algorithm is better!
PS, has anybody here been able to beat it on a regular basis?