#include "random_player.h" #include RandomPlayer::RandomPlayer(char name) { this->name = name; srand(time(0)); // Seed the random number generator } void RandomPlayer::selectLineLocation(Board& board, int& row, int& col) { int rows = board.getRows(); int cols = board.getCols(); // Loop until a valid move is found do { row = rand() % (2 * rows - 1); // Random row within the board dimensions col = rand() % (2 * cols - 1); // Random column within the board dimensions } while (!board.isLineValid(row, col)); // Check if the move is valid } char RandomPlayer::getName() const { return this->name; }