how to represent a tic tac toe tree in c++
hi,
i want to know how to represent a tic tac toe tree in c++
also tell me how to write a tic tac toe game.
Not tic-tac-toe AGAIN
ok then. you can search gdnet to find everywhichweay to do this.
But to answer your question...
What you have is a struct which contains:
an array of 9 elements which are all pointers of type struct_name
you have the board state (an array of 9 ints)
And an int which signifies if this is an end state
Now how to do tic-tac-toe, ther are heaps of ways, from minimax with alphabeta, to simple rules, to a learning system.
From,
Nice coder
ok then. you can search gdnet to find everywhichweay to do this.
But to answer your question...
What you have is a struct which contains:
an array of 9 elements which are all pointers of type struct_name
you have the board state (an array of 9 ints)
And an int which signifies if this is an end state
Now how to do tic-tac-toe, ther are heaps of ways, from minimax with alphabeta, to simple rules, to a learning system.
From,
Nice coder
It has come to my attention that tic tac toe is a common introduction to programming assignment at some schools.
I noticed an increase in tic-tac-toe questions since the competition at http://www.newgameprojects.net/ that is giving away Visual Studio .NET to the winner.
... and that making a tic-tac-toe is given as a suggestion in the forum faq. I guess we'll have to cope with these question - of course, if they come from the newgameprojects compettion, then I suggest their author to put them on the corresponding NGP forum.
It is not that bad - and perhaps someone will have the good idea to write a complete article on the possible tic tac toe algorithms.
Regards,
It is not that bad - and perhaps someone will have the good idea to write a complete article on the possible tic tac toe algorithms.
Regards,
If you're new to programming, tic-tac-toe has enough programming elements to be very helpful. Here's an implementation that I tried. But as the other's suggested, there's lots of ways to go about this. If you don't get bored with the game, trying the same thing multiple ways is a nice learning tool. Have fun.
My website
My website
I'm using Tic-Tac-Toe to relearn a programming language that I've been away from for way too long. B-)
No, it's C++. But thanks for remembering. B-) You can still find my Qbasic site at http;//qbasic.gbgames.com in case you haven't seen my posts on qb45.com and vplanetmag.com.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement