 $(document).ready ->
+  game = new Gameplay()
+
+  inning = 1
+
   $("#start-button").on "click", ->
-    game = new Gameplay()
-    game.playGame()
+    game.playGame(inning)
+    inning += 1
 
 class @Gameplay
   PITCH_BALL_PROB = 50

      battingResult = @atBatResult(result, score, baseOccupancy)
      if battingResult.result is "strikeout" or battingResult.result is "pop fly out" or battingResult.result is "ground ball out"
        outs += 1
      #@displayAddGameReport("<b>battingResult: #{JSON.stringify(battingResult)}</b>")
      score = battingResult.score
      @displayAddOut()
      @displayClearBalls()


    return score

  playGame: (inning) ->
    score = 0

    #@displayAddGameReport("<h3>PLAY BALL!!!</h3>")
    #while innings.length isnt 0
    #inning = innings.shift()

    if inning < 10
      @displayAddGameReport("<br><b>#{inning} Inning - Top</b>")
      side = "away"
      score = @playInning(score)
