-- Compiled with roblox-ts v1.2.7 local TS = _G[script] local TicTacToePlayer = TS.import(script, script.Parent, "TicTacToePlayer").TicTacToePlayer --[[ * * A player that makes a random move depending on the empty * cells on the board. This is mainly for example purposes * of how to create a player. ]] local TicTacToeRandomPlayer do local super = TicTacToePlayer TicTacToeRandomPlayer = setmetatable({}, { __tostring = function() return "TicTacToeRandomPlayer" end, __index = super, }) TicTacToeRandomPlayer.__index = TicTacToeRandomPlayer function TicTacToeRandomPlayer.new(...) local self = setmetatable({}, TicTacToeRandomPlayer) return self:constructor(...) or self end function TicTacToeRandomPlayer:constructor(...) super.constructor(self, ...) end function TicTacToeRandomPlayer:makeMove(board) local emptyCells = board:getEmptyCells() local randomCell = emptyCells[math.floor(math.random() * #emptyCells) + 1] return { row = randomCell:getRow(), col = randomCell:getCol(), } end end return { TicTacToeRandomPlayer = TicTacToeRandomPlayer, }