Check my TicTacToe! Feedback is welcomed :)

It tries to block, win, play random otherwise. Only one strategy can beat it.

The code is kind of spaghetti … I tried to organize it as possible as I can but I believe it can be way better …

TicTacToe