I have finally completed my tic-tac-toe using react-redux.
For the hard difficulty setting I try to do something like the minimax algorithm.
What I do first, is create a tree with all possible combinations of game boards, and then just move along the tree while the game progresses.
The only issue I have is that it can be a bit slow when generating the tree. This is especially a problem for users in mobile devices. And, we all know how nowadays everyone is super impatient
Do you have any suggestions of alternative approaches which could help speed up the load time?
The live app is here: https://zelite.github.io/tic-tac-toe/
Here is the code to create the tree of all boards: https://github.com/zelite/tic-tac-toe/blob/master/src/tree.js
And here are the functions which do most of the work on boards: https://github.com/zelite/tic-tac-toe/blob/master/src/board.js (checking empty cells, adding symbols and so on).