moved play_opponents_moves code to a js file