Wanna play my game?
Hey, wanna play my connect four game? This is my first attempt at AI and the comp plays a pretty decent game although it plays a little too predictably at higher levels because how it views the best move never really changes... it really needs one more recursive level for it to be REALLY strong since it falls for too many traps that are 8 levels deep! :) With school and projects though haven't had time to get in that extra level...
I lost to a level 1 computer by accident :D Then I won 7 consecutive games with this strategy:
Very entertaining doing that :D
| | | |X| |O| |
| | | | | |O| |
| | |X|X| |O| |
| | | | | |O| |
|O|X|X|X| |O| |
:D You mean you beat level 1 like that? I hope you didn't beat level 7 like that, how embarrasing for me! :D
Work on it during school, that's what I do, except in Social Studies, we have an over-energetic student teacher who doesn't like naps or anything else besides picking through trash and social studies.
Heh, I beat it on level 7.. first try.
I played first and the AI was good for some time, then it just allowed me to get an easy four by playing in row 6.
| | |☻|☺|☻| | | |
| | |☺|☺|☺| | | |
|☻| |☻|☺|☻| |☻| |
|☺| |☺|☻|☻| |☺|☺|
1 2 3 4 5 6 7 8
Try those weak tactics on my level 7 setting!
Computer wins -> 0
Player wins -> 1
can I get the source code for that plz?:D
Thats a pretty cool game!
Actually Sang-drax, the computer is too smart for its own good, which is why it moved on row 6. If you notice, if you had gone on row 6 first, it would have lost, since he would have to go 6 to stop you, then you hit row six again with a trap where if the comp stops your four diagonal you got the four horizontal on top of that - an example of a 8 level trap that my comp falls for since it only looks 7 levels deep :) I haven't QUITE figured out how to debug it so the stupid thing doesn't just give up when it sees it's lost. After all, it should make you work for it! But everytime I try to tinker with it, it messes up the AI somewhere else... I'll post the source code this weekend from home... although I'm a little embarrassed since I wrote it before I learned anything object oriented so its VERY MESSY! Straight off my old QuickBasic techniques! :D