# What is the optimal strategy for this triangular board game?

I saw a board game somewhere and I want to know the optimal strategy for it.

The game is played on a triangular board with 21 slots:

The two players, red and blue, take turns to put numbered circles in one of the empty slots. Red goes first. The number on the circle increases from 1 to 10 as the game progresses. The number is not controlled by the players, so for the first move, Red must put a red circle with 1, then Blue must put a blue circle with 1, then Red must put a red circle with 2, then Blue must put a blue circle with 2, and so on (all the way to the number 10).

For convenience, I will refer to the move of putting a circle with the number $$k$$ in the $$m$$th slot of the $$n$$th row $$(n, m, k)$$

As an example, here is the start of a game:

• Red goes $$(1, 1, 1)$$
• Blue goes $$(5, 1, 1)$$
• Red goes $$(3, 3, 2)$$
• Blue goes $$(6, 1, 2)$$
• Red goes $$(3, 1, 3)$$
• Blue goes $$(2, 2, 3)$$

After the above move, the board looks like this:

After a few more moves the game ends:

To determine the winner, we take the surrounding slots of the last empty slot, which in this game is

• red 7
• red 6
• red 10
• blue 10

and add up the sums of blue and red separately. The sum for blue is $$10$$ and the sum for red is $$7 + 6 + 10 = 23$$. Whoever has a smaller sum wins. In this case, blue wins.

What is the optimal strategy for this game so that the player either wins or ties every time?

I tried finding this out myself by writing an AI using a heuristic function and a minimax algorithm. I wrote the AI but it always beats me... And I can't see any patterns in its moves...

I have put the code for the AI onto GitHub. It is written in Swift and can only run on a Mac. Link

• @DrXorile This is the video that I saw it in: youtube.com/watch?v=zMLE7a3faI4 Dec 25, 2018 at 1:43
• I believe that's 'Black Hole' by Walter Joris. Dec 25, 2018 at 1:45
• It is entirely within the realms of possibility that the reason for not finding any patterns is that there are none. Many games are NP-hard, meaning that the only (known) way to win is to brute-force every option.
– Bass
Dec 27, 2018 at 11:34
• is there any online version of this game that I can play against a computer or should I write my own program for this?
– Oray
Jan 21, 2019 at 11:52
• @Oray I have added a link to a GitHub repo that I made for this. Jan 21, 2019 at 17:08

There is no online version of the game, but I believe I found a method

which makes red cannot lose the game, but at worst blue can make the game a draw.

First of all, I believe the game

is not actually about the numbers you are putting in the circles but domination on some area and force the other player put more values into another place and create more chance to win. Because the numbers are in an order for both players and blue is going to decide where the game ends actually. So red needs to dominate some area where there will be more blues than reds by using the advantage of starting the game.

So

Red needs to try to dominate any symmetric 3 area shown below by ignoring whatever blue is doing:

For example:

Assuming

Blue is not aware of this and randomly plays, for example as below:

Such as

After this point

red will win since there are not much connected circles left on the empty slots.

Now assume that

Blue is trying to block our red with his moves against red's domination on these 3 area

Then the game would be like;

so

whatever blue does, red would put at least 6 points to one area mentioned before, making the number of blue values on the other places more than red's.

Here is how to take at least 6 points in one area:

These

green circles are the common slots for the 3 areas I had mentioned, so red will start to put his first number on one of them randomly, even blue put his number into any other 2 slots left, red can put his second number into the last one as shown below:

for example;

so

red could put two reds in the left area whereas blue could not put any number into that area yet. After this, red will put his numbers always into the left area which will result 6 reds 4 blues at most.

and

we know that there will 6 blues and 4 reds on that the specific area

such as below

Lastly

blue can try to dominate another area where red is not trying to do,

such as;

and

blue's turn to play. But he will lose wherever he puts his value (if asked, I can show how)

Therefore,

red will always a find a spot where red will be safe with the sum at the end, or at worst the game will be a draw but I am not sure there is such a case without examining and showing it in detail.

• "Now assume that blue is trying to block our red..." not sure about this bit. Let's suppose they are fighting over rot13(gur gbc sbhe ebjf). You claim "whatever blue does, red would put at least 6..." But what if rot13(oyhr iregvpnyyl zveebef erq'f zbirf -- rkprcg vs erq cynlf gbc, oyhr cynlf zvqqyr bs guveq ebj, be ivpr irefn -- gura nsgre gurl rnpu cynl svir zbirf, gur gbc sbhe ebjf ner svyyrq naq gur sbhegu ebj vf flzzrgevp). Jan 21, 2019 at 17:11
• @deepthought check the edited version, so you would know how it will be possible :)
– Oray
Jan 22, 2019 at 8:06
• Thanks for explaining. But I don't understand why you say those are the rot13(pbzzba fybgf). I can see that rot13(rnpu bs gubfr fybgf vf pbzzba gb gjb bs gur guerr nernf), but it looks like rot13(fvk bgure fybgf unir gur fnzr cebcregl, jung vs oyhr hfrf gurz)? Jan 22, 2019 at 17:08
• Thank you. This seems to be right. What if the board is bigger? Let’s say it’s 9 rows. Do I follow a similar approach? - first moving in the three circles where the three triangular areas overlap, then dominating one of the areas. Jan 23, 2019 at 22:16

The best idea is likely to choose an area of 10 circles to fill and put your smallest numbers on the edge of that area. You then fill that area. You should end up with an empty circle touching nothing or very small numbers.

• Is the AI for this boardgame online? Jan 20, 2019 at 9:20
• I have added a link to a GitHub repo that I made for this. Jan 21, 2019 at 17:08