#include #include "board.h" #include "human.h" #include "smart.h" #include "dumb.h" // main program to test player object int main(void) { human d1(1); smart d2(2); bool rval; board b; int p=1; int t=0; while (t<10) { if (p==1) { rval = d1.makemove(b); } else { rval = d2.makemove(b); } if (d1.has_won(b)) { cout << "Player 1 thinks he won " << endl; } if (d2.has_won(b)) { cout << "Player 2 thinks he won " << endl; } if (d1.has_lost(b)) { cout << "Player 1 thinks he lost " << endl; } if (d2.has_lost(b)) { cout << "Player 2 thinks he lost " << endl; } if (rval) { cout << "Player " << p << " Moved : " << endl; b.print(); } else { cout << "Player " << p << " can't move ! " << endl; b.print(); break; } t++; p = 3-p; } }