The Mathematics of Chess