Crappy chess implementation in C++