Wednesday, January 21, 2009

Connect 4

I tried to use the same algorithm I did with Tic-Tac toe on Connect four, and i ran into some problem with memory---

actually i never explained how i got tic-tac-toe to work... it actually was an interesting story...

So as the game plays against itself over and over again, it records what spaces lead to losses, what moves lead to wins, and what moves lead to ties. There is then a statistic taken every turn to see which one is the best, and the statistics are constantly updated. However it is a bit more than statistics, hardly but distinct, i programmed a "gullibility factor", well that's what I call it. the wins could only possibly get up to 10, or whatever the 'gullibility factor' was and it could only get so bad as the gullibility factor.

Now dealing with ties is where something interesting happened, when both computers saw ties as a form of winning, both of them simply made the same moves over and over again, not surprising. When both computers considered them loses , when they played against a human they failed, they would choose to lose instead of tie sometimes.

However when one computer considered ties wins, and the other one considered ties loses, one of them succeeded. To me it seemed like a pessimist vs optimist situation, and i believe the optimist won this round. Because the program considered ties wins and the others loses, the one that thought they were loses continually changed strategy, while the other one was able to learn and find all the different possibilities of winning. While the loser, simply ended up moving randomly in the end when you try to go against it.

Now I need to do something with Connect 4, but there are too many combinations, and the RAM just cant take it on any computer I can come in contact with. So Now I must come up with a new strategy, I think I will come up with it tomorrow.... lots of thinking to do

No comments:

Post a Comment