Code now passes either player winning and ties.