Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AI and Deep Learning by (50.2k points)

I'm writing a game that's a variant of Gomoku. Basically a tic tac toe on a huge board.

Wondering if anyone knows a good AI strategy for the game. My current implementation is very stupid and takes a long time (O(n^3), approx 1-2 second to make a move):

-(void) moveAI { //check if the enemy is trying to make a line horizontally, vertically, or diagonally //O(n^3 * 3) [self checkEnemies]; //check if we can make a line horizontally, vertically, or diagonally //O(n^3 * 3) [self checkIfWeCanMakeALine]; //otherwise just put the piece randomly [self put randomly]; }

1 Answer

0 votes
by (107k points)

Go-Moku is played on the 19*19 go-board. The object of this board game is to get five stones in a row, be it horizontal, vertical or diagonal. You have noticed that six in a row do not win, such a construction is called an overline. In that case, the game just goes on till you achieve your goal. Of course, the game can end in a draw, if the players agree or the whole board is full of stones while no player has five stones in a row on the board.

You can refer the following link for the strategies that AI has to solve the game:

https://www.yourturnmyturn.com/rules/go-moku.php

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...