#include #include #include "token.h" void playGame (int lenOfGame, int maxRoll); main () { int maxRoll, lenOfGame; cout << "This is a simulation of a board game" << endl << endl; cout << "Enter number of winning square ---> "; cin >> lenOfGame; cout << "Enter maximum dice roll for a token ---> "; cin >> maxRoll; cout << endl << endl; playGame (lenOfGame, maxRoll); cout << endl << endl; return 0; } void playGame (int lenOfGame, int maxRoll) { token p1('A',1, lenOfGame, maxRoll); token p2('B',1, lenOfGame, maxRoll); bool p1Turn=true, done=false; do { if (p1Turn) { done = p1.move(); cout << p1.getName() << " - " << p1.getPos() << " "; } else { done = p2.move(); cout << p2.getName() << " - " << p2.getPos() << endl; } p1Turn = !p1Turn; } while (!done); cout << endl << endl; cout << p1.getName() << " - " << p1.getPos() << " "; cout << p2.getName() << " - " << p2.getPos() << endl; cout << endl; }