connect 4

Sort:
bobbyDK

connect 4 is a fun little game.but connect 4 has been solved in 1988 with perfect play the player going first can force a win by starting in the middle.
I have read the strategy and can now beat the computer even at best level almost every time. the strategy is almost easy to a chessplayer control the middle and you control the game. by controlling the middle you have a lot of changes to connect 4.
always place pieces that increases your changes to connect 4 the most.

Do you still want to play the game going second?

Martin_Stahl

I guess the question would be, can you beat the computer when you go second? If it can't beat you in that case you probably need a better program Tongue out

I had to do a connect 4 program in college. It was pretty good but it wasn't the best program in class (though it did decently against the other programs). My algorithm wasn't the best but it played a pretty good game.

bobbyDK

you are right, but would a human still find it funny to play against another human. knowing that it is solved and that you probably lose if you go second even against another human.

at least you wouldn't bet on winning unless you go first.

Martin_Stahl

True. I haven't really thought about the best method to win in connect 4, though the premise is pretty straight forward. The program that I wrote, starts looking in the middle and works its way out but primarily is a breadth-first search (if I'm recalling correctly) with branch pruning.

I don't think I ever beat it at its full search depth (I think it was based on time, but I would have to look at it to be sure). That was 8 or so years ago, so my memory is a little fuzzy on that. Still have the progam on my computer somewhere.