Lab 13

TicTacToeFor Lab

Today's lab is about using Linked List with Struct(recording game progress) for Tic-tac-toe game.

This lab is prelude of program 6, think about how use the similiar idea in program 6.

During playing game, the print out in the screen should be like below:

Welcome to Tic-tac-toe. On each move enter 1-9, corresponding to the location

into which you want to place a piece.  The locations are:

1 2 3

4 5 6

7 8 9

. . .

. . .

. . .

1. Location 1-9 for X: 5

List is:

. . .

. . .

. . .

. . .

. X .

. . .

2. Location 1-9 for O: 7

List is:

. . .

. . .

. . .

. . .

. X .

. . .

. . .

. X .

O . .

3. Location 1-9 for X: 4

List is:

. . .

. . .

. . .

. . .

. X .

. . .

. . .

. X .

O . .

. . .

X X .

O . .

4. Location 1-9 for O: ...

TODO tasks for today:

Point 1. Finish the definition of struct Node, following the comment of the fields in the struct declaration.

Point 2. Finish function displayList( char board[]).

Point 3. Finish function appendToList(Node *&pHead, Node *&pTail, char board[], char playerToMove, int moveNumber)