Awalé board on my garden table, March 15, 2013Following Le Monde puzzle #810, I tried to code an R program (not reproduced here) to optimise an awalé game but the recursion was too rich for R:

Error: evaluation nested too deeply:
infinite recursion / options(expressions=)?

even with a very small number of holes and seeds in the awalé… Searching on the internet, it seems the computer simulation of a winning strategy for an awalé game still is an open problem! Here is a one-step R function that does  not produce sure gains for the first player, far from it, as shown by the histogram below…  I would need a less myopic strategy by iterating  this function at least twice.

# x current state of the awale,
# side side of the awale (0 vs 1)


for (i in ((1:N)+N*side)){

 if (x[i]>0){
   for (t in 0:(x[i]-1))

   if (side){ gain=(last<=N)
    }else{ gain=(last>N)}

   if (gain){# ending up on the right side
     while (((last>0)&&(side))||((last>N)||(!side)))
     if ((y[last]==2)||(y[last]==3)){
          }else{ break()}
if (max(rewa)>0){
  }else{ sol=rang=((1:N)+N*side)[x[((1:N)+N*side)]>0]
   if (length(rang)>1) sol=sample(rang,1,prob=x[rang]^3)}


gains of player 1 obtained from using associated R code

4 Responses to “awalé”

  1. Good topic! I wrote a Mancala-playing Python program for an AI course. It looked 7 moves ahead, which was enough to crush me consistently. The game itself is very widely played and there are quite a few variations in the details. It was fascinating to research it! (Mancala, Owari, Aware, Awale, etc. There are tournaments and serious competition out there.)

    Of course, the ultimate game to program is Go/Baduk/Wei’chi.

  2. What do you mean by “computer simulation of a winning strategy”? Awale is solved, there is a database of the value of each move for each possible position.

    Here is an applet that plays using the database:

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: