Rock, Paper, Scissors Engine in JavaScript