title: PARS squash game
body: <p>below is my code that simulates a PARS scored squash game:</p>
  
  <pre><code>import random
  def game(ra, rb):
      prob_a = ra / (ra + rb)
  
      points_a = 0
      points_b = 0
  
      winning_score = 11
  
      while points_a &lt; winning_score and points_b &lt; winning_score:
          prob = random.random()
          if prob &lt; prob_a:
              points_a += 1
          else:
              points_b += 1
      return(points_a, points_b)
  
  game(70,30)
  </code></pre>
  
  <p>It works fine, but I'm not sure how to make sure that player a or b has to win by 2 clear points.</p>