Gomoku array-based AI-algorithm?
Posted
by Lasse V. Karlsen
on Stack Overflow
See other posts from Stack Overflow
or by Lasse V. Karlsen
Published on 2010-05-02T12:08:47Z
Indexed on
2010/05/02
12:17 UTC
Read the original article
Hit count: 1042
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 didn't account for a lot of code. I wonder if anyone knows this algorithm and has some links to some source or theory about it.
The things I remember was that it basically allocated an array that covered the entire board. Then, whenever I, or it, placed a piece, it would add a number of weights to all locations on the board that the piece would possibly impact.
For instance (note that the weights are definitely wrong as I don't remember those):
1 1 1
2 2 2
3 3 3
444
1234X4321
3 3 3
2 2 2
1 1 1
Then it simply scanned the array for an open location with the lowest or highest value.
Things I'm fuzzy on:
- Perhaps it had two arrays, one for me and one for itself and there was a min/max weighting?
- There might've been more to the algorithm, but at its core it was basically an array and weighted numbers
Does this ring a bell with anyone at all? Anyone got anything that would help?
© Stack Overflow or respective owner