Self Learning Algorithm for Tic Tac Toe