Question

I'm working on a Gomoku game I'm currently done with GUI etc, and I need to code the IA and Rule Checker (for optional rules such as Capture, forbidden patterns etc). I was planning on representing the board with an int array something like:

uint goban[361];

Which would represent a 19 * 19 Goban (board). Let's say we can split a 32bit integer in 4 byte and within each byte we can stock metadata like this for example:

  • 1st byte: Is this case empty/black/white ?
  • 2nd byte: Is this case part of a special pattern ?
  • 3rd byte: In which position of the pattern am I ?
  • 4th byte: Am I capturable ?

I don't know if this kind of solution is suitable for a Gomoku AI but the main problem I've is how to write it properly. Let's take pattern:

 -OO-O-

It's a open & free three, it has space inside and at the extremity. How Am I supposed to link this pattern with a static representation without coordinates ?

One other concern is when should I update pattern and how because out of 361 case it can be pretty long if I update the previous figure to this:

 XOO-O-

I've to update all four case so I don't think it's apropriate, plus it can affect many other vertical / diagonal patterns.

Should I rather make a list of patterns currently on the map like this:

std::list<ThreatList> tlist;

and make the map a simple tribool or char array ?

I want my data representation to give me maximum information to get a fast update of the influence map which would be filled by my evaluation function. I've read couple things about threat space search and other Gomoku algorithm but they don't talk about data representation and I don't get how to do it correctly, can you please help me find a clean way to represent pattern and how to update them.

Thanks you.

No correct solution

OTHER TIPS

Take a look at this open source Gomoku: https://github.com/garretraziel/gomoku

I think you will find a lot of interesting ideas in there.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top