there is are algorithms for each difficulty, like for example hard bot will put O or X in a corner if you put O or X is in center. You just need to create a string of if conditions to do that.
Tes, hood idea