2020-06-25

mindstalk: (thoughtful)
A while back I installed a gomoku app for my phone. It's a simple "connect five" game, no frills or variations. I'd been playing it mostly on instinct, but last night/this morning decided to think more about it.

What was obvious before:

Open four (row of four without opposing cap on either end) is a win; if the opponent caps one end, you extend the other and win.

Open three has to be responded to, lest it become an open four.

Closed (semi-closed, capped on one end) four has to be responded to, lest it become a five and win.

Two open threes are a win, since they can't both be interrupted.

(Assuming of course there isn't some side effect, where the enemy capping your three gives them a four.)

What I realized:

Open threes start life as an open two. So a strong move, keeping momentum, is to make an open three that also makes an open two; the opponent will respond to the three, and you can threaten again from the two

Making two open twos at once loses momentum, but at least makes options.

Alternatively, making a three or two (or more) that caps an enemy two reduces their options. Or when capping an open three, choose the end that lets you make an open two or three of your own. (Maybe! You want to also look at what they might do on the other end, since they'll probably push to a closed four that you have to respond to.) Or, cap the end such that the other end would benefit you if they *did* push to a four.

Results:

That's not really deep analysis, but it seems to have helped a lot, to beat the AI less randomly than before.

Unrelatedly, this program seems to "give up" when you're set to win.  Like if you make an open four, instead of trying to cap one end, it'll usually just go play somewhere else.  At the higher AI levels, it seems to "give up" in some positions where I didn't notice a forced win.  This could just be a bug, or could be deeper insight.  I suppose then the ultimate AI would play randomly from the beginning, since I go first and Gomoku is known to be winnable by the first player, like tic-tac-toe.  (I think it's known that it is winnable, but not readily how.)

Profile

mindstalk: (Default)
mindstalk

July 2025

S M T W T F S
  12345
6789101112
13141516171819
20212223242526
272829 3031  

Page Summary

Most Popular Tags

Expand Cut Tags

No cut tags

Style Credit

Page generated 2025-08-31 07:17
Powered by Dreamwidth Studios