The problem is solved - thanks to everyone for the hints! The issue was a getchar(); statement in the beginning of the play_game(); function, which I had put in attempts to clear the buffer but without enough knowledge how to do so correctly.