I have created a tactactoe game in Android and it is great. But this game has 3*3 game play. In 3*3 game we can implement our manual AI(Filling corner position first) or we can use Minimax algorithm to get best move. This is great for 3*3 board. But when I tried the same algorithm for 4*4 and 5*5 the algorithm is taking a huge time to determine the best move. Hence I can not use minimax algorithm.
So what can I do now? I want to implement different level with different goal like below
Here it is 6*6 board and the goal(Consecutive symbol to win) is 5. So I want to design an ai for this dynamic board with dynamic goal.Goal can be 3,4,5 etc. How can I do that? Thanks in advance.