inserted function to validate player's guess
var play function