C++ implementation of Snake