C++ implementation of the gold mines solver