Tic Tac Toe coding challenge

Here is my solution for tic tac toe where the computer never loses.