An AI that solves the peg game