The source from the Mat Buckland book Game AI by Example.