Ported to C++, logic fully functional

I'm not planning on continuing the Java version, will focus on C++.