#include "game.h" Game::Game() { // initialize the number of columns that each "color" will contain lastColumnIndex = CHECKBOXES - 1; // set up lockOut for(int i = 0; i pointsGuide = {0,1,3,6,10,15,21,28,36,45,55,66,78}; // check players' card for marked boxes for(int i = 0;i for now it is only printed below fprintf(stdout, "Player %s has a secret of: %d",lastPlayer.savedName, lastPlayer.secretNumber); return turnInProgress; } // look for the position of a comma in userInput for(int i = 0;i < userInput.size();i++) { // a comma is found, set position and stop if(',' == userInput[i]) { pos = i; break; } } // assuming there is a comma and it is not the first character, split userInput into two parts on the comma if(0 players[player].cumulativeOlok.getXCount(turn.moves[i].color) { fprintf(stdout, "Player[%d] %s tried to check off column 12 without minimum X\n", player, players[player].savedName); return false; } } return true; } bool Game::leftToRightRule(int player, Turn turn) { for(int i = 0; i turn.moves[i].index) { fprintf(stdout,"Player[%d] %s not following left to right rule X\n", player, players[player].savedName); return false; } } return true; } bool Game::checkTurn (int player, Turn turn) { // check all rules for turn verification return lockOutRule( player, turn) && leftToRightRule( player, turn) && isMoveRepresentedInDie(player, turn); } void Game::addX(int player, int color, int index) { } struct Move Game::translateToMove(std::string temp) { int temp2 = stoi(temp); struct Move newMove; // find the color newMove.color = (temp2/colors); // find the index, subtracted 1 from checkboxes because it is lockout bonus box - only interested in scored boxes newMove.index = (temp2%(CHECKBOXES-1)); return newMove; }