Questions tagged [gomoku]
38 questions
15
votes
6 answers
What would be a good AI strategy to play Gomoku?
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…

Enrico Susatyo
- 19,372
- 18
- 95
- 156
12
votes
6 answers
Gomoku array-based AI-algorithm?
Way way back (think 20+ years) I encountered a Gomoku game source code in a magazine that I typed in for my computer and had a lot of fun with.
The game was difficult to win against, but the core algorithm for the computer AI was really simply and…

Lasse V. Karlsen
- 380,855
- 102
- 628
- 825
4
votes
3 answers
PHP session not working with JQuery Ajax?
Update, Solved:
After all this I found out that I was calling an old version of my code in the update ajax.
'boardControl.php' instead of 'boardUpdate.php' These are the kinds of mistakes that make programing fun.
I'm writing a browser gomoku…

Bolt_Head
- 1,453
- 5
- 17
- 26
3
votes
5 answers
Sliding window method for pattern recognition in SWI-Prolog
I would like to find the most eloquent and efficient method, algorithmically speaking, to count occurrences of some patterns in SWI-Prolog.
For now, my solution uses DCG and looks like this:
count_occurrences(Pattern, List, Count) :-
…

René Chenard
- 55
- 5
3
votes
5 answers
Gomoku: limited time to search
I'm creating a C program to play Gomoku. It uses Minimax search to decide on the best move. However, it can only search for the best move for 10 seconds. How to I determine when my search function has spent 10 seconds searching. If you could provide…

Spencer
- 4,018
- 10
- 33
- 43
3
votes
1 answer
How do i start with Gomoku?
I read about Gomoku that it can be implemented using Minimax and Alpha-Beta Pruning algorithms. So, i read these algorithms and now understand how the game will be solved. But when i sat to down to code, I am facing problem how to approach it.
As…

firstTry
- 31
- 1
- 2
2
votes
1 answer
Java Heap Space Issue with my MCTS Gomoku player
When I run my program I get this error:
Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
at MCTSNode.setPossibleMoves(MCTSNode.java:66)
at MCTSNode.Expand(MCTSNode.java:167)
at…

oldfield33
- 23
- 5
2
votes
1 answer
How to improve Alpha-beta pruning performance
Here is my code for gomoku AI. So now my AI is currently run over 5 seconds but the time limit is 5 seconds. I am trying to improve the performance so I try move ordering but it seems not works. I calculate the score first in getChildStates(int…

Tam Chak Kuen
- 31
- 1
- 3
2
votes
1 answer
Gomoku state-of-the-art tech
usually people use pn-search or pn^2 Or df-pn to answer if there is a win solution.
then they use alpha-beta pruning on the min-max game tree with a good evaluation function
they can reach a depth of 15 ply or even more
now there is a Monte Carlo…

user3194730
- 51
- 1
- 5
1
vote
1 answer
Gomoku (Connect Five) Minimax algorithm AI doesn't care about losing
This is a continuation from my previous question.
So, I think I've made a lot of progress. The AI now seems to generally make the best move, and go for wins, but one last problem I'm having is that it doesn't seem to care about losing. That is, if…

John Smith
- 8,567
- 13
- 51
- 74
1
vote
1 answer
Gomoku (Connect Five) Minimax algorithm not finding obvious win
I'm developing a very simple connect five (gomoku) AI for fun in Javascript using minimax and alpha beta pruning. I've just been following some tutorials online, but for some reason I can't quite get it to work. I think I have a logical bug…

John Smith
- 8,567
- 13
- 51
- 74
1
vote
1 answer
c++ Gomoku diagonal checker
so I am a relatively new to coding. So I have to make a Gomoku game for a project. Gomoku is like tic-tac-toe, but have to get five in a row. Have been given certain restrictions such as a board size of 6x6 to 15x15. The use of at least one class. I…

Gabriella
- 23
- 5
1
vote
1 answer
Computer Player for a Gomoku Game in C++
A few time ago I made a game similar to Gomoku in C++ that is taking between two players.
Now I want to make it Player vs Computer.
I tried to do it in simplest way, by making a function of computer to pick a random cell but I still haven't…

tyler0504
- 21
- 5
1
vote
2 answers
How to enable turn taking within game of Gomoku javafx
I am having difficulty in enablng turn taking within my program.
A tile on the board gets clicked and those coordinates are passed to playMakeMove() which makes the move in the board matrix and sets text to represent a move visually.
Although when…

Javasaurusrex
- 123
- 1
- 7
1
vote
2 answers
A good Minimax representation in Gomoku?
I am trying to code a Gomoku (five in a row) game in Java as an individual project. For the AI, I understand that the use of a Minimax function with Alpha-beta Pruning is a good way to approach this. However, I'm having a little trouble…

jyt
- 15
- 2
- 5