Liam O'Donnell-Carey

Software Developer/Gameplay Programmer – liamodc@gmail.com

Menu

Skip to content
  • Portfolio
  • Resumé
  • About

Othello AI

Solo Project

Through Xamarin Studio, C# and use of the Monte Carlo Tree Search algorithm, implemented an AI for the skilful playing of a digital version of the board game Othello.

othelloGUI

Code Sample

// Select a Space according to the MCTS algorithm and change its color
public void GetMCTSMove(Player activePlayer, Player inactivePlayer)
{

this.activePlayer = activePlayer;
this.inactivePlayer = inactivePlayer;stopwatch.Restart();do
{

Node searchNode = TreePolicy (currentNode);
double reward = DefaultPolicy (searchNode);
PropogateResult (searchNode, reward);

}while (stopwatch.ElapsedMilliseconds < TIME_BUDGET);
stopwatch.Stop();

// Value of 0 passed into GetBestChild to ensure no exploration, such that child with highest reward is selected
Node bestChild = GetBestChild(currentNode, 0);

currentNode = bestChild;

}

Related

Post navigation

Ophidia →
Blog at WordPress.com.
    • Liam O'Donnell-Carey
    • Sign up
    • Log in
    • Copy shortlink
    • Report this content
    • Manage subscriptions
 

Loading Comments...