Code improved. It is Ready to apply AI to the game.