-
Advice on a Tic Tac Toe program needed!!!! (this should be an easy one for the pros out there)
Hello, I am a student at the University of Akron, majoring in Computer Science.
I currently have an assignment to create a two human player tic tac toe game.
We are using Microsoft Visual C++ version 6.0. I have to create a class TicTacToe
and within that class there needs to be a private data member "board" that
is a 3-by-3 array. I understand how to create the array, but what I need
help with is how to create the two players and test for whether the game
has been won by one of the players of if the game is a draw. If anybody is
able to give me hints as to how I would go about doing this, I would be very
grateful. Thanks for your time! 
~Em
-
Re: Advice on a Tic Tac Toe program needed!!!! (this should be an easy one for the pros out there)
Well what u have to do is simple
Allot all 9 boxes such values so that u get the same total when u add
them vertically or horizontally or diagonally(This si the Winning total).
then check for the totals after each move. if the total is the same as the
Winning total the player has won
if want more details i recommend a boook of Artificial intelligence by
Rich
"EM" <ecm4@uakron.edu> wrote:
>
>Hello, I am a student at the University of Akron, majoring in Computer Science.
>I currently have an assignment to create a two human player tic tac toe
game.
>We are using Microsoft Visual C++ version 6.0. I have to create a class
TicTacToe
>and within that class there needs to be a private data member "board" that
>is a 3-by-3 array. I understand how to create the array, but what I need
>help with is how to create the two players and test for whether the game
>has been won by one of the players of if the game is a draw. If anybody
is
>able to give me hints as to how I would go about doing this, I would be
very
>grateful. Thanks for your time! 
> ~Em
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks