Hi, I'm Henry

I'm a Computer Science student at the University of Cambridge.

I write here about various things that cross my mind, and also keep a record of a few of the more interesting bits of software I've written in my spare time. If you would like to contact me, you can send me an email at henry@hmercer.com.

Projects

Threes! RaspAI (2014)

Threes! RaspAI is an expectimax AI distributed across a small Raspberry Pi cluster which plays Threes!. Having implemented the game logic and an expectimax algorithm in C++, I integrated multithreading into the application using the C++11 threading library. Having parallelized the application on a single computer, I decided to extend the application by implementing a sockets-based distribution system to parallelize the AI across a cluster of Raspberry Pis.

Past Game End State

Here is the highest-scoring final game state:

Last move (#1035): right

Final score: 248826 (Δ=+3)

Next tile: 2
12
96
6
192
1536
192
3072
3
24
96
384
12
1
1
6
24
  1. Threes! AI — Game Representation
  2. Threes! AI — A Simple Distribution Method

More Projects

Posts

Evaluating Logic Circuits with Ternary Logic Graphs

This article describes how a basic RS NOR flip-flop circuit can be simulated using a directed graph constructed with source nodes (which output a value to nodes), terminal nodes (which take input from nodes), and gate nodes (which take input from nodes, do something with it, and provide the output to nodes). This graph propagates changed values to simulate the flow of electricity in the real-life logic circuit. It is based on a ternary logic system, which consists of a third unknown value in addition to the normal true and false values. In this article, balanced ternary is used to represent these values: +1 for true, 0 for unknown, and -1 for false. The language used in this article is Swift, as I wanted to try it out here by building (the bones of) a circuit simulator iOS app.

Continue reading

More Posts