Your browser version is outdated. We recommend that you update your browser to the latest version.

I'm always interested in algorithms and developing my programming skills. With my two degrees in Zoology / Biology, I've always been interested in simulations of living things - Conway's game of Life, Barnsely's fern, flocking birds. I'm interested in graph theory, network analysis and I've tinkered extensively with game theory and optimisation strategies.

I encourage my team to try algorithm challenges such as Google's Code Jam - there are dozens of others. They are good for learning new languages, and keeping the brain interested.

Robocode

Posted 3/20/2017

A long time ago I spent some time working with Robocode - a cute and fun tank simulator, where you could write a control program for a tank in Java and then see how well it performed against other tanks - either yours or others, downloaded. You were able to try different strategies - do you go beserk and run at the other tanks firing wildly, or do you lurk in corners, sniping.  You had access to a basic Tank object, with some events (like spotting another tank with your radar, or being hit by a shell) and then some basic options : drive forward, turn right, turn gun left : you then wrote your own Java code to link it all together.

Read the rest of this entry »

Boids

Posted 3/7/2017

I was talking about Boids the other day - and so I had to code it up again for my Android phone. It looks good in these screenshots, but when moving I think it's prettiest thing I've ever written.

Mazes

Posted 3/7/2017

After I joined Fiserv, I needed to get to meet people - so I presented a lunch talk about Mazes, generating and solving them. There are a huge range of algorithms for both tasks; I even created a little version of 3d Monster Maze which is arguably the scariest game I've ever played.

Port

Posted 3/2/2017

I was interested in an optimisation strategy for a port, where containers are offloaded from a ship, picked up by a straddle" (tall vehicle that can pick up a container and move it around) and taken to a separate area to be taken away by trucks.

Given a certain scenario (number of containers, port layout) what's the optimum number of straddles ? Too few, and the containers queue up on the ship; too many, and the containers queue up in the truck park (and the straddles keep getting in each others way.

I've built a simulation where I can set up containers, ships, cranes, straddles and trucks. I lay out the port, with impassable areas to make it more interesting, and give the vehicles the ability to route find (A*). I then tinker with different set ups to find the minimum time needed to transport all containers from a ship to the truck park.

A set of classes were built to implement the model; I then wrapped different systems around it (JavaFX for desktop analysis, Android for a hand-held demo, and then an automated system to run multiple models and produce the statistics I wanted.

Result - it's complicated.

Three examples of different ports, running on an Android phone.Three examples of different ports, running on an Android phone.

Read the rest of this entry »

Simulations of life

Posted 3/2/2017

Conway's game of Life is very famous - old (it was first modelled by hand with black and white counters), it's one of my standard exercises when picking up a new language. Simple rules display complex emergent behaviour.

Barnsley's Fern is something I've just stumbled across - a fractal, where a simple set of four equations can generate stunningly life-like ferns. Barnsely speculates that the growth of a fern must be related ... 

 Four examples of a fern produced by the same four equations with slightly different parameters.Four examples of a fern produced by the same four equations with slightly different parameters.

While at university I met Craig Reynolds who was working on his Boids simulation, where a set of "entities" given very simple rules (stay close to the others, but not to close) give rise to complex, life-like flocking behaviour.

Read the rest of this entry »

Poker Hand

Posted 5/23/2015

The first one ties in with the poker games I've been playing with my kids : take a standard hand of 5 cards from a normal pack (including two jokers) and calculate the highest score possible.

Read the rest of this entry »

Recreational algorithms

Posted 5/23/2015

 For work, I'm running a regular series of programming challenges : recreational algorithms.

They are all going to straight forward programming challenges : language agnostic, simply designed to challenge people's ability to understand and solve optimization problems. Some of them will be things I'm interested in, some will be borrowed or adapted from Google Code Jam and other competitions.