I'm trying to create tic tac toe program which never would lose to player, but I'm doing very bad... Can you suggest me what should I do? Just any ideas (no code needed, want to write code by my own). Thanks.
What can you suggest me on creating games like tic tac toe?
Started by G33k, Jan 12 2010 12:55 PM
2 replies to this topic
#1
Posted 12 January 2010 - 12:55 PM
|
|
|
#2
Posted 12 January 2010 - 06:44 PM
There are only so many ways a tic-tac-toe game can go. If you don't want it to lose, look into the ways to win and force a stale-mate. You will need two different strategies based on whether the player gets to go first or not. If you go first all you need to do is pick the middle and then counter every move to force a stale-mate. There are only two strategies that i know off the top of my head that can force a win but they are very situational (i'll let you figure them out) so as long as you know what not to do, you can make your program attempt the force win and then if the correct situation does not occur, just counter to force a stale-mate.
twas brillig
#3
Posted 13 January 2010 - 02:12 PM
Do you know the standard strategy to never lose tic-tac-toe? Can you always not-lose when playing against a person? You just need to reimplement that logic.


Sign In
Create Account


Back to top









