my first attempt to write a self learning algorithm in c++