kd
BAN USERI . Approach 1
===================================
Simplest one is to have both players as users.
Use a 3X3 matrix and fill:
Value 1 for player 1
Value -1 for player 2
Value 0 for empty cells
Take input turn by turn 9 times. Parse through the matrix to identify same values along rows, columns or diagonals to identify winner if any.
2. Approach 2
=========================
Use mathematical properties of magic square.
This approach helps in implementing a computer play the game.
Computer can block a user move by checking a cell such that it satisfies magic square property.
This simplifies the game by reducing it to just a set of equations.
By involving more mathematics -- based on earlier moves of user, computer can learn user behavior to identify probabilities -- stochastic processes/transition matrix -- to predict future moves and mixing it with magic square properties we can block a user move.
This logic can be easily expanded to higher order matrices complicating user moves :)
-- Krishna Devale
Reprichardcstrong, Accountant at AppPerfect
I am a modern magician, except I transform complicated technical ideas into user-friendly images before the eyes of your company ...
Repkaylafgioia, Cloud Support Associate at Absolute Softech Ltd
Hi, I am Kayla from Elkins USA. I am working as Project management and I have professional 3-year experience in ...
RepMariaHobbs, Consultant at Adobe
Hi, I am Maria Hobbs from NewYork.Teach career development courses for designated areas. Develop, evaluate and revise course materials ...
RepKimRPierce, Employee at Achieve Internet
I am a customer service-oriented Travel Agent in Travel and Tourism industries. I strongly believe that the skills and abilities ...
Synchronous: Blocking I/O, a process waits until request for I/O is completed and then resumes I/O
- kd September 15, 2012Asynchronous: Non Blocking I/O, process requests I/O, until I/O is serviced another job is processed, when I/O completes, process is interrupted to operate on data from I/O