TicTacToe in Ruby using minimax algorithm