How to develop your own AI

Some source codes in C++ for those who are interested.