created generic play function which will repeatedly play the game with the input move function