Code moved from main.cpp to a new class Tronmoi. It has been partially translated too.