Skip to content
Go implementation of TEN and its AI
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Build Status

Go implementation of TEN with MCTS AI and a simple Cloud Function endpoint.

It now reached performance parity with its Java counterpart on my local machine. There is not much performance difference between the Java and Go version, even if the Go program will be compiled to native code. This is probably because Java has a highly optimized garbage collector, since MCTS algorithm needs to create deep trees.

Getting Started

Running Locally

go run

Deploy to Google Cloud Functions

# We need more memory to create MCTS simulation trees.
gcloud functions deploy HandleTenAIMoveRequest --runtime go111 --trigger-http --memory=2048MB

Additional Rules

The main rules are described here.

To balance the game, I specified an additional rule that when there is same number of big squares for black and white, white wins. It can compensate for the first-move advantage for black. With this rule, the winning probability for black and white is 53:47. Without the rule, the ratio is 7:3.

You can’t perform that action at this time.