Press the flag to start and space to restart.
I did this for an assignment for a coding club. I hope you like it and enjoy! (P.S. I take tips too!)