12251 - HW4 Tic Tac Toe   

Description

Your program requires the following features:

  • Receive a series of nodes representing the possible steps in Tic tac toe.
  • Generate the corresponding game tree.
  • Report "Win" and the "winning" status if the game tree has one
  • Report "Tie" and the post-order order of the game tree
  • Example

  • Example

Input

Example 1

Each node of the tree consists of:

  • ID
  • The parent node ID (-1 represents null for root node)
  • Position (x,y) and the player mark {O, or X}
  • To simplify the game, each node will only have at most two possible children.

 

Example 2

 

Output

Example 1

Example 2

Sample Input  Download

Sample Output  Download

Tags




Discuss