added template tic-tac-toe algorithm