hello! i would like to know how to to create a tic-tac-toe using STL list to implement the game? i do not understand how to make use linked list to implement it. Our conditions for the game are as follows:
Each row of the grid is actually a n+3 offset on the list.
The data structures chosen must first be initialized with space or blank.
A function to check the winning condition can be called each time a position on the grid is used.
So can u tell me how do i go abt with this programming.Thx.
I think he means that the game's first row occupy positions 0-2, second row occupy 3-5 and third row occupy 6-8, so that a gven row/column psition (r,c) can be found as 3r+c. That's a guess.
You need to think of which combinations, in terms of rows and columns, constitute winning combinations in tic-tac-toe. For example, if (0,0), (0,1) and (0,2) are all X's, x has won since the first row is full.
Take a chequered piece of parper, write down all winners, and create a program that can check if the current board contents have a winning combination in it...