//******************************************************************************
//
// CS 240C : Spring 2003 Ohio University Travis Dillon
// Project 6 : Checkers
// file : prog6.cc
// started : 05-13-03
//
//******************************************************************************
#include "prog6.h"
using namespace main_savitch_14;
using namespace std;
int main( )
{
Checker instance; //checker object
Checker::who winner; //play returns who, this is the winner
char answer;
string restline;
cout <<"\nEnter piece row and column, then move row and column."
<< "\nA legal move is 2233\n22 33 is not legal"
<<"\nFor jumps, enter initial piece position and it's final position.\n";
do
{
winner = instance.play( ); //play the game
switch (winner) //last player to move wins the game.
{
case Checker::HUMAN: cout << "Player 1 wins" << endl; break;
case Checker::COMPUTER: cout << "Computer wins" << endl; break;
}
cout << "Do you want to play again? [Y/N] ";
cin >> answer;
getline(cin, restline); //junk input, only want the y or n
}while (toupper(answer) == 'Y');
return EXIT_SUCCESS;
}