#include <iostream>

using namespace std;

void printLegend()
{
  cout << "Tic-Tac-Toe Legend: " << endl << endl;
  cout << "_1_|_2_|_3_" << endl
       << "_4_|_5_|_6_" << endl
       << " 7 | 8 | 9 " << endl << endl << endl;
  
}

void printBoard()
{
  
  cout << "_" << grid[0][0] << "_|_" << grid[0][1] << "_|_" << grid[0][2] << "_" << endl
       << "_" << grid[1][0] << "_|_" << grid[1][1] << "_|_" << grid[1][2] << "_" << endl
       << " " << grid[2][0] << " | " << grid[2][1] << " | " << grid[2][2] << endl;
    
}

void queryPlayAgain()
{
  cout << "Would you like to play again? (Y/N)";
}

void queryMove()
{
  cout << "Please select your move (1 - 9, L for Legend, $ to quit): ";
}

void printOutcome(string winner)
{
  cout << "Game over!" << endl;
  cout << "Final board positions : " << endl;
  printBoard();
  if(winner == "human")
    cout << "You beat the computer!" << endl;
  else if(winner == "computer")
    cout << "The computer beat you!" << endl;
  else if(winner == "tie")
    cout << "Tie game!  There was no winner." << endl;
}

void printError()
{
  cout << endl << "There was an error in your input, please enter 1 - 9, L, $, Y, or N" << endl;
}

void printInstructions()
{
  cout << "The objective of the game is to place three of your pieces in a row on the tic-tac-toe grid." << endl << "Select a position to place your piece by entering the number corresponding to your position on the legend." << endl;
}

