code day_3.0: implement the game control