<class>
  <keyword > class </keyword>
  <identifier class, defined> PongGame </identifier>
  <symbol > { </symbol>
  <classVarDec>
    <keyword > static </keyword>
    <identifier > PongGame </identifier>
    <identifier name=instance type=PongGame kind=Static index=0 declared> instance </identifier>
    <symbol > ; </symbol>
  </classVarDec>
  <classVarDec>
    <keyword > field </keyword>
    <identifier > Bat </identifier>
    <identifier name=bat type=Bat kind=Field index=0 declared> bat </identifier>
    <symbol > ; </symbol>
  </classVarDec>
  <classVarDec>
    <keyword > field </keyword>
    <identifier > Ball </identifier>
    <identifier name=ball type=Ball kind=Field index=1 declared> ball </identifier>
    <symbol > ; </symbol>
  </classVarDec>
  <classVarDec>
    <keyword > field </keyword>
    <keyword > int </keyword>
    <identifier name=wall type=int kind=Field index=2 declared> wall </identifier>
    <symbol > ; </symbol>
  </classVarDec>
  <classVarDec>
    <keyword > field </keyword>
    <keyword > boolean </keyword>
    <identifier name=exit type=boolean kind=Field index=3 declared> exit </identifier>
    <symbol > ; </symbol>
  </classVarDec>
  <classVarDec>
    <keyword > field </keyword>
    <keyword > int </keyword>
    <identifier name=score type=int kind=Field index=4 declared> score </identifier>
    <symbol > ; </symbol>
  </classVarDec>
  <classVarDec>
    <keyword > field </keyword>
    <keyword > int </keyword>
    <identifier name=lastWall type=int kind=Field index=5 declared> lastWall </identifier>
    <symbol > ; </symbol>
  </classVarDec>
  <classVarDec>
    <keyword > field </keyword>
    <keyword > int </keyword>
    <identifier name=batWidth type=int kind=Field index=6 declared> batWidth </identifier>
    <symbol > ; </symbol>
  </classVarDec>
  <subroutineDec>
    <identifier > PongGame </identifier>
    <identifier subroutine, defined> new </identifier>
    <symbol > ( </symbol>
    <parameterList>
    </parameterList>
    <symbol > ) </symbol>
    <subroutineBody>
      <symbol > { </symbol>
      <statements>
        <doStatement>
          <keyword > do </keyword>
          <identifier class, used> Screen </identifier>
          <symbol > . </symbol>
          <identifier function, used> clearScreen </identifier>
          <symbol > ( </symbol>
          <symbol > ) </symbol>
          <symbol > ; </symbol>
        </doStatement>
        <letStatement>
          <keyword > let </keyword>
          <identifier name=batWidth type=int kind=Field index=6 used> batWidth </identifier>
          <symbol > = </symbol>
          <expression>
            <term>
              <integerConstant > 50 </integerConstant>
            </term>
          </expression>
          <symbol > ; </symbol>
        </letStatement>
        <letStatement>
          <keyword > let </keyword>
          <identifier name=bat type=Bat kind=Field index=0 used> bat </identifier>
          <symbol > = </symbol>
          <expression>
            <term>
              <identifier class, used> Bat </identifier>
              <symbol > . </symbol>
              <identifier function, used> new </identifier>
              <symbol > ( </symbol>
              <symbol > ) </symbol>
            </term>
          </expression>
          <symbol > ; </symbol>
        </letStatement>
        <letStatement>
          <keyword > let </keyword>
          <identifier name=ball type=Ball kind=Field index=1 used> ball </identifier>
          <symbol > = </symbol>
          <expression>
            <term>
              <identifier class, used> Ball </identifier>
              <symbol > . </symbol>
              <identifier function, used> new </identifier>
              <symbol > ( </symbol>
              <symbol > ) </symbol>
            </term>
          </expression>
          <symbol > ; </symbol>
        </letStatement>
        <doStatement>
          <keyword > do </keyword>
          <identifier class, used> ball </identifier>
          <symbol > . </symbol>
          <identifier function, used> setDestination </identifier>
          <symbol > ( </symbol>
          <symbol > ) </symbol>
          <symbol > ; </symbol>
        </doStatement>
        <doStatement>
          <keyword > do </keyword>
          <identifier class, used> Screen </identifier>
          <symbol > . </symbol>
          <identifier function, used> drawRectangle </identifier>
          <symbol > ( </symbol>
          <symbol > ) </symbol>
          <symbol > ; </symbol>
        </doStatement>
        <doStatement>
          <keyword > do </keyword>
          <identifier class, used> Output </identifier>
          <symbol > . </symbol>
          <identifier function, used> moveCursor </identifier>
          <symbol > ( </symbol>
          <symbol > ) </symbol>
          <symbol > ; </symbol>
        </doStatement>
        <doStatement>
          <keyword > do </keyword>
          <identifier class, used> Output </identifier>
          <symbol > . </symbol>
          <identifier function, used> printString </identifier>
          <symbol > ( </symbol>
          <symbol > ) </symbol>
          <symbol > ; </symbol>
        </doStatement>
        <letStatement>
          <keyword > let </keyword>
          <identifier name=exit type=boolean kind=Field index=3 used> exit </identifier>
          <symbol > = </symbol>
          <expression>
            <term>
              <keyword > false </keyword>
            </term>
          </expression>
          <symbol > ; </symbol>
        </letStatement>
        <letStatement>
          <keyword > let </keyword>
          <identifier name=score type=int kind=Field index=4 used> score </identifier>
          <symbol > = </symbol>
          <expression>
            <term>
              <integerConstant > 0 </integerConstant>
            </term>
          </expression>
          <symbol > ; </symbol>
        </letStatement>
        <letStatement>
          <keyword > let </keyword>
          <identifier name=wall type=int kind=Field index=2 used> wall </identifier>
          <symbol > = </symbol>
          <expression>
            <term>
              <integerConstant > 0 </integerConstant>
            </term>
          </expression>
          <symbol > ; </symbol>
        </letStatement>
        <letStatement>
          <keyword > let </keyword>
          <identifier name=lastWall type=int kind=Field index=5 used> lastWall </identifier>
          <symbol > = </symbol>
          <expression>
            <term>
              <integerConstant > 0 </integerConstant>
            </term>
          </expression>
          <symbol > ; </symbol>
        </letStatement>
        <returnStatement>
          <keyword > return </keyword>
          <expression>
            <term>
              <keyword > this </keyword>
            </term>
          </expression>
          <symbol > ; </symbol>
        </returnStatement>
      </statements>
      <symbol > } </symbol>
    </subroutineBody>
  </subroutineDec>
  <subroutineDec>
    <keyword > void </keyword>
    <identifier subroutine, defined> dispose </identifier>
    <symbol > ( </symbol>
    <parameterList>
    </parameterList>
    <symbol > ) </symbol>
    <subroutineBody>
      <symbol > { </symbol>
      <statements>
        <doStatement>
          <keyword > do </keyword>
          <identifier class, used> bat </identifier>
          <symbol > . </symbol>
          <identifier function, used> dispose </identifier>
          <symbol > ( </symbol>
          <symbol > ) </symbol>
          <symbol > ; </symbol>
        </doStatement>
        <doStatement>
          <keyword > do </keyword>
          <identifier class, used> ball </identifier>
          <symbol > . </symbol>
          <identifier function, used> dispose </identifier>
          <symbol > ( </symbol>
          <symbol > ) </symbol>
          <symbol > ; </symbol>
        </doStatement>
        <doStatement>
          <keyword > do </keyword>
          <identifier class, used> Memory </identifier>
          <symbol > . </symbol>
          <identifier function, used> deAlloc </identifier>
          <symbol > ( </symbol>
          <symbol > ) </symbol>
          <symbol > ; </symbol>
        </doStatement>
        <returnStatement>
          <keyword > return </keyword>
          <symbol > ; </symbol>
        </returnStatement>
      </statements>
      <symbol > } </symbol>
    </subroutineBody>
  </subroutineDec>
  <subroutineDec>
    <keyword > void </keyword>
    <identifier subroutine, defined> newInstance </identifier>
    <symbol > ( </symbol>
    <parameterList>
    </parameterList>
    <symbol > ) </symbol>
    <subroutineBody>
      <symbol > { </symbol>
      <statements>
        <letStatement>
          <keyword > let </keyword>
          <identifier name=instance type=PongGame kind=Static index=0 used> instance </identifier>
          <symbol > = </symbol>
          <expression>
            <term>
              <identifier class, used> PongGame </identifier>
              <symbol > . </symbol>
              <identifier function, used> new </identifier>
              <symbol > ( </symbol>
              <symbol > ) </symbol>
            </term>
          </expression>
          <symbol > ; </symbol>
        </letStatement>
        <returnStatement>
          <keyword > return </keyword>
          <symbol > ; </symbol>
        </returnStatement>
      </statements>
      <symbol > } </symbol>
    </subroutineBody>
  </subroutineDec>
  <subroutineDec>
    <identifier > PongGame </identifier>
    <identifier subroutine, defined> getInstance </identifier>
    <symbol > ( </symbol>
    <parameterList>
    </parameterList>
    <symbol > ) </symbol>
    <subroutineBody>
      <symbol > { </symbol>
      <statements>
        <returnStatement>
          <keyword > return </keyword>
          <expression>
            <term>
              <identifier name=instance type=PongGame kind=Static index=0 used> instance </identifier>
            </term>
          </expression>
          <symbol > ; </symbol>
        </returnStatement>
      </statements>
      <symbol > } </symbol>
    </subroutineBody>
  </subroutineDec>
  <subroutineDec>
    <keyword > void </keyword>
    <identifier subroutine, defined> run </identifier>
    <symbol > ( </symbol>
    <parameterList>
    </parameterList>
    <symbol > ) </symbol>
    <subroutineBody>
      <symbol > { </symbol>
      <varDec>
        <keyword > var </keyword>
        <keyword > char </keyword>
        <identifier name=key type=char kind=Var index=0 declared> key </identifier>
        <symbol > ; </symbol>
      </varDec>
      <statements>
        <whileStatement>
          <keyword > while </keyword>
          <symbol > ( </symbol>
          <expression>
            <term>
              <symbol > ~ </symbol>
              <term>
                <identifier name=exit type=boolean kind=Field index=3 used> exit </identifier>
              </term>
            </term>
          </expression>
          <symbol > ) </symbol>
          <symbol > { </symbol>
          <statements>
            <whileStatement>
              <keyword > while </keyword>
              <symbol > ( </symbol>
              <expression>
                <term>
                  <symbol > ( </symbol>
                  <expression>
                    <term>
                      <identifier name=key type=char kind=Var index=0 used> key </identifier>
                    </term>
                    <symbol > = </symbol>
                    <term>
                      <integerConstant > 0 </integerConstant>
                    </term>
                  </expression>
                  <symbol > ) </symbol>
                </term>
                <symbol > &amp; </symbol>
                <term>
                  <symbol > ( </symbol>
                  <expression>
                    <term>
                      <symbol > ~ </symbol>
                      <term>
                        <identifier name=exit type=boolean kind=Field index=3 used> exit </identifier>
                      </term>
                    </term>
                  </expression>
                  <symbol > ) </symbol>
                </term>
              </expression>
              <symbol > ) </symbol>
              <symbol > { </symbol>
              <statements>
                <letStatement>
                  <keyword > let </keyword>
                  <identifier name=key type=char kind=Var index=0 used> key </identifier>
                  <symbol > = </symbol>
                  <expression>
                    <term>
                      <identifier class, used> Keyboard </identifier>
                      <symbol > . </symbol>
                      <identifier function, used> keyPressed </identifier>
                      <symbol > ( </symbol>
                      <symbol > ) </symbol>
                    </term>
                  </expression>
                  <symbol > ; </symbol>
                </letStatement>
                <doStatement>
                  <keyword > do </keyword>
                  <identifier class, used> bat </identifier>
                  <symbol > . </symbol>
                  <identifier function, used> move </identifier>
                  <symbol > ( </symbol>
                  <symbol > ) </symbol>
                  <symbol > ; </symbol>
                </doStatement>
                <doStatement>
                  <keyword > do </keyword>
                  <identifier function, used> moveBall </identifier>
                  <symbol > ( </symbol>
                  <symbol > ) </symbol>
                  <symbol > ; </symbol>
                </doStatement>
                <doStatement>
                  <keyword > do </keyword>
                  <identifier class, used> Sys </identifier>
                  <symbol > . </symbol>
                  <identifier function, used> wait </identifier>
                  <symbol > ( </symbol>
                  <symbol > ) </symbol>
                  <symbol > ; </symbol>
                </doStatement>
              </statements>
              <symbol > } </symbol>
            </whileStatement>
            <ifStatement>
              <keyword > if </keyword>
              <symbol > ( </symbol>
              <expression>
                <term>
                  <identifier name=key type=char kind=Var index=0 used> key </identifier>
                </term>
                <symbol > = </symbol>
                <term>
                  <integerConstant > 130 </integerConstant>
                </term>
              </expression>
              <symbol > ) </symbol>
              <symbol > { </symbol>
              <statements>
                <doStatement>
                  <keyword > do </keyword>
                  <identifier class, used> bat </identifier>
                  <symbol > . </symbol>
                  <identifier function, used> setDirection </identifier>
                  <symbol > ( </symbol>
                  <symbol > ) </symbol>
                  <symbol > ; </symbol>
                </doStatement>
              </statements>
              <symbol > } </symbol>
              <keyword > else </keyword>
              <symbol > { </symbol>
              <statements>
                <ifStatement>
                  <keyword > if </keyword>
                  <symbol > ( </symbol>
                  <expression>
                    <term>
                      <identifier name=key type=char kind=Var index=0 used> key </identifier>
                    </term>
                    <symbol > = </symbol>
                    <term>
                      <integerConstant > 132 </integerConstant>
                    </term>
                  </expression>
                  <symbol > ) </symbol>
                  <symbol > { </symbol>
                  <statements>
                    <doStatement>
                      <keyword > do </keyword>
                      <identifier class, used> bat </identifier>
                      <symbol > . </symbol>
                      <identifier function, used> setDirection </identifier>
                      <symbol > ( </symbol>
                      <symbol > ) </symbol>
                      <symbol > ; </symbol>
                    </doStatement>
                  </statements>
                  <symbol > } </symbol>
                  <keyword > else </keyword>
                  <symbol > { </symbol>
                  <statements>
                    <ifStatement>
                      <keyword > if </keyword>
                      <symbol > ( </symbol>
                      <expression>
                        <term>
                          <identifier name=key type=char kind=Var index=0 used> key </identifier>
                        </term>
                        <symbol > = </symbol>
                        <term>
                          <integerConstant > 140 </integerConstant>
                        </term>
                      </expression>
                      <symbol > ) </symbol>
                      <symbol > { </symbol>
                      <statements>
                        <letStatement>
                          <keyword > let </keyword>
                          <identifier name=exit type=boolean kind=Field index=3 used> exit </identifier>
                          <symbol > = </symbol>
                          <expression>
                            <term>
                              <keyword > true </keyword>
                            </term>
                          </expression>
                          <symbol > ; </symbol>
                        </letStatement>
                      </statements>
                      <symbol > } </symbol>
                    </ifStatement>
                  </statements>
                  <symbol > } </symbol>
                </ifStatement>
              </statements>
              <symbol > } </symbol>
            </ifStatement>
            <whileStatement>
              <keyword > while </keyword>
              <symbol > ( </symbol>
              <expression>
                <term>
                  <symbol > ( </symbol>
                  <expression>
                    <term>
                      <symbol > ~ </symbol>
                      <term>
                        <symbol > ( </symbol>
                        <expression>
                          <term>
                            <identifier name=key type=char kind=Var index=0 used> key </identifier>
                          </term>
                          <symbol > = </symbol>
                          <term>
                            <integerConstant > 0 </integerConstant>
                          </term>
                        </expression>
                        <symbol > ) </symbol>
                      </term>
                    </term>
                  </expression>
                  <symbol > ) </symbol>
                </term>
                <symbol > &amp; </symbol>
                <term>
                  <symbol > ( </symbol>
                  <expression>
                    <term>
                      <symbol > ~ </symbol>
                      <term>
                        <identifier name=exit type=boolean kind=Field index=3 used> exit </identifier>
                      </term>
                    </term>
                  </expression>
                  <symbol > ) </symbol>
                </term>
              </expression>
              <symbol > ) </symbol>
              <symbol > { </symbol>
              <statements>
                <letStatement>
                  <keyword > let </keyword>
                  <identifier name=key type=char kind=Var index=0 used> key </identifier>
                  <symbol > = </symbol>
                  <expression>
                    <term>
                      <identifier class, used> Keyboard </identifier>
                      <symbol > . </symbol>
                      <identifier function, used> keyPressed </identifier>
                      <symbol > ( </symbol>
                      <symbol > ) </symbol>
                    </term>
                  </expression>
                  <symbol > ; </symbol>
                </letStatement>
                <doStatement>
                  <keyword > do </keyword>
                  <identifier class, used> bat </identifier>
                  <symbol > . </symbol>
                  <identifier function, used> move </identifier>
                  <symbol > ( </symbol>
                  <symbol > ) </symbol>
                  <symbol > ; </symbol>
                </doStatement>
                <doStatement>
                  <keyword > do </keyword>
                  <identifier function, used> moveBall </identifier>
                  <symbol > ( </symbol>
                  <symbol > ) </symbol>
                  <symbol > ; </symbol>
                </doStatement>
                <doStatement>
                  <keyword > do </keyword>
                  <identifier class, used> Sys </identifier>
                  <symbol > . </symbol>
                  <identifier function, used> wait </identifier>
                  <symbol > ( </symbol>
                  <symbol > ) </symbol>
                  <symbol > ; </symbol>
                </doStatement>
              </statements>
              <symbol > } </symbol>
            </whileStatement>
          </statements>
          <symbol > } </symbol>
        </whileStatement>
        <ifStatement>
          <keyword > if </keyword>
          <symbol > ( </symbol>
          <expression>
            <term>
              <identifier name=exit type=boolean kind=Field index=3 used> exit </identifier>
            </term>
          </expression>
          <symbol > ) </symbol>
          <symbol > { </symbol>
          <statements>
            <doStatement>
              <keyword > do </keyword>
              <identifier class, used> Output </identifier>
              <symbol > . </symbol>
              <identifier function, used> moveCursor </identifier>
              <symbol > ( </symbol>
              <symbol > ) </symbol>
              <symbol > ; </symbol>
            </doStatement>
            <doStatement>
              <keyword > do </keyword>
              <identifier class, used> Output </identifier>
              <symbol > . </symbol>
              <identifier function, used> printString </identifier>
              <symbol > ( </symbol>
              <symbol > ) </symbol>
              <symbol > ; </symbol>
            </doStatement>
          </statements>
          <symbol > } </symbol>
        </ifStatement>
        <returnStatement>
          <keyword > return </keyword>
          <symbol > ; </symbol>
        </returnStatement>
      </statements>
      <symbol > } </symbol>
    </subroutineBody>
  </subroutineDec>
  <subroutineDec>
    <keyword > void </keyword>
    <identifier subroutine, defined> moveBall </identifier>
    <symbol > ( </symbol>
    <parameterList>
    </parameterList>
    <symbol > ) </symbol>
    <subroutineBody>
      <symbol > { </symbol>
      <varDec>
        <keyword > var </keyword>
        <keyword > int </keyword>
        <identifier name=bouncingDirection type=int kind=Var index=0 declared> bouncingDirection </identifier>
        <symbol > , </symbol>
        <identifier name=batLeft type=int kind=Var index=1 declared> batLeft </identifier>
        <symbol > , </symbol>
        <identifier name=batRight type=int kind=Var index=2 declared> batRight </identifier>
        <symbol > , </symbol>
        <identifier name=ballLeft type=int kind=Var index=3 declared> ballLeft </identifier>
        <symbol > , </symbol>
        <identifier name=ballRight type=int kind=Var index=4 declared> ballRight </identifier>
        <symbol > ; </symbol>
      </varDec>
      <statements>
        <letStatement>
          <keyword > let </keyword>
          <identifier name=wall type=int kind=Field index=2 used> wall </identifier>
          <symbol > = </symbol>
          <expression>
            <term>
              <identifier class, used> ball </identifier>
              <symbol > . </symbol>
              <identifier function, used> move </identifier>
              <symbol > ( </symbol>
              <symbol > ) </symbol>
            </term>
          </expression>
          <symbol > ; </symbol>
        </letStatement>
        <ifStatement>
          <keyword > if </keyword>
          <symbol > ( </symbol>
          <expression>
            <term>
              <symbol > ( </symbol>
              <expression>
                <term>
                  <identifier name=wall type=int kind=Field index=2 used> wall </identifier>
                </term>
                <symbol > &gt; </symbol>
                <term>
                  <integerConstant > 0 </integerConstant>
                </term>
              </expression>
              <symbol > ) </symbol>
            </term>
            <symbol > &amp; </symbol>
            <term>
              <symbol > ( </symbol>
              <expression>
                <term>
                  <symbol > ~ </symbol>
                  <term>
                    <symbol > ( </symbol>
                    <expression>
                      <term>
                        <identifier name=wall type=int kind=Field index=2 used> wall </identifier>
                      </term>
                      <symbol > = </symbol>
                      <term>
                        <identifier name=lastWall type=int kind=Field index=5 used> lastWall </identifier>
                      </term>
                    </expression>
                    <symbol > ) </symbol>
                  </term>
                </term>
              </expression>
              <symbol > ) </symbol>
            </term>
          </expression>
          <symbol > ) </symbol>
          <symbol > { </symbol>
          <statements>
            <letStatement>
              <keyword > let </keyword>
              <identifier name=lastWall type=int kind=Field index=5 used> lastWall </identifier>
              <symbol > = </symbol>
              <expression>
                <term>
                  <identifier name=wall type=int kind=Field index=2 used> wall </identifier>
                </term>
              </expression>
              <symbol > ; </symbol>
            </letStatement>
            <letStatement>
              <keyword > let </keyword>
              <identifier name=bouncingDirection type=int kind=Var index=0 used> bouncingDirection </identifier>
              <symbol > = </symbol>
              <expression>
                <term>
                  <integerConstant > 0 </integerConstant>
                </term>
              </expression>
              <symbol > ; </symbol>
            </letStatement>
            <letStatement>
              <keyword > let </keyword>
              <identifier name=batLeft type=int kind=Var index=1 used> batLeft </identifier>
              <symbol > = </symbol>
              <expression>
                <term>
                  <identifier class, used> bat </identifier>
                  <symbol > . </symbol>
                  <identifier function, used> getLeft </identifier>
                  <symbol > ( </symbol>
                  <symbol > ) </symbol>
                </term>
              </expression>
              <symbol > ; </symbol>
            </letStatement>
            <letStatement>
              <keyword > let </keyword>
              <identifier name=batRight type=int kind=Var index=2 used> batRight </identifier>
              <symbol > = </symbol>
              <expression>
                <term>
                  <identifier class, used> bat </identifier>
                  <symbol > . </symbol>
                  <identifier function, used> getRight </identifier>
                  <symbol > ( </symbol>
                  <symbol > ) </symbol>
                </term>
              </expression>
              <symbol > ; </symbol>
            </letStatement>
            <letStatement>
              <keyword > let </keyword>
              <identifier name=ballLeft type=int kind=Var index=3 used> ballLeft </identifier>
              <symbol > = </symbol>
              <expression>
                <term>
                  <identifier class, used> ball </identifier>
                  <symbol > . </symbol>
                  <identifier function, used> getLeft </identifier>
                  <symbol > ( </symbol>
                  <symbol > ) </symbol>
                </term>
              </expression>
              <symbol > ; </symbol>
            </letStatement>
            <letStatement>
              <keyword > let </keyword>
              <identifier name=ballRight type=int kind=Var index=4 used> ballRight </identifier>
              <symbol > = </symbol>
              <expression>
                <term>
                  <identifier class, used> ball </identifier>
                  <symbol > . </symbol>
                  <identifier function, used> getRight </identifier>
                  <symbol > ( </symbol>
                  <symbol > ) </symbol>
                </term>
              </expression>
              <symbol > ; </symbol>
            </letStatement>
            <ifStatement>
              <keyword > if </keyword>
              <symbol > ( </symbol>
              <expression>
                <term>
                  <identifier name=wall type=int kind=Field index=2 used> wall </identifier>
                </term>
                <symbol > = </symbol>
                <term>
                  <integerConstant > 4 </integerConstant>
                </term>
              </expression>
              <symbol > ) </symbol>
              <symbol > { </symbol>
              <statements>
                <letStatement>
                  <keyword > let </keyword>
                  <identifier name=exit type=boolean kind=Field index=3 used> exit </identifier>
                  <symbol > = </symbol>
                  <expression>
                    <term>
                      <symbol > ( </symbol>
                      <expression>
                        <term>
                          <identifier name=batLeft type=int kind=Var index=1 used> batLeft </identifier>
                        </term>
                        <symbol > &gt; </symbol>
                        <term>
                          <identifier name=ballRight type=int kind=Var index=4 used> ballRight </identifier>
                        </term>
                      </expression>
                      <symbol > ) </symbol>
                    </term>
                    <symbol > | </symbol>
                    <term>
                      <symbol > ( </symbol>
                      <expression>
                        <term>
                          <identifier name=batRight type=int kind=Var index=2 used> batRight </identifier>
                        </term>
                        <symbol > &lt; </symbol>
                        <term>
                          <identifier name=ballLeft type=int kind=Var index=3 used> ballLeft </identifier>
                        </term>
                      </expression>
                      <symbol > ) </symbol>
                    </term>
                  </expression>
                  <symbol > ; </symbol>
                </letStatement>
                <ifStatement>
                  <keyword > if </keyword>
                  <symbol > ( </symbol>
                  <expression>
                    <term>
                      <symbol > ~ </symbol>
                      <term>
                        <identifier name=exit type=boolean kind=Field index=3 used> exit </identifier>
                      </term>
                    </term>
                  </expression>
                  <symbol > ) </symbol>
                  <symbol > { </symbol>
                  <statements>
                    <ifStatement>
                      <keyword > if </keyword>
                      <symbol > ( </symbol>
                      <expression>
                        <term>
                          <identifier name=ballRight type=int kind=Var index=4 used> ballRight </identifier>
                        </term>
                        <symbol > &lt; </symbol>
                        <term>
                          <symbol > ( </symbol>
                          <expression>
                            <term>
                              <identifier name=batLeft type=int kind=Var index=1 used> batLeft </identifier>
                            </term>
                            <symbol > + </symbol>
                            <term>
                              <integerConstant > 10 </integerConstant>
                            </term>
                          </expression>
                          <symbol > ) </symbol>
                        </term>
                      </expression>
                      <symbol > ) </symbol>
                      <symbol > { </symbol>
                      <statements>
                        <letStatement>
                          <keyword > let </keyword>
                          <identifier name=bouncingDirection type=int kind=Var index=0 used> bouncingDirection </identifier>
                          <symbol > = </symbol>
                          <expression>
                            <term>
                              <symbol > - </symbol>
                              <term>
                                <integerConstant > 1 </integerConstant>
                              </term>
                            </term>
                          </expression>
                          <symbol > ; </symbol>
                        </letStatement>
                      </statements>
                      <symbol > } </symbol>
                      <keyword > else </keyword>
                      <symbol > { </symbol>
                      <statements>
                        <ifStatement>
                          <keyword > if </keyword>
                          <symbol > ( </symbol>
                          <expression>
                            <term>
                              <identifier name=ballLeft type=int kind=Var index=3 used> ballLeft </identifier>
                            </term>
                            <symbol > &gt; </symbol>
                            <term>
                              <symbol > ( </symbol>
                              <expression>
                                <term>
                                  <identifier name=batRight type=int kind=Var index=2 used> batRight </identifier>
                                </term>
                                <symbol > - </symbol>
                                <term>
                                  <integerConstant > 10 </integerConstant>
                                </term>
                              </expression>
                              <symbol > ) </symbol>
                            </term>
                          </expression>
                          <symbol > ) </symbol>
                          <symbol > { </symbol>
                          <statements>
                            <letStatement>
                              <keyword > let </keyword>
                              <identifier name=bouncingDirection type=int kind=Var index=0 used> bouncingDirection </identifier>
                              <symbol > = </symbol>
                              <expression>
                                <term>
                                  <integerConstant > 1 </integerConstant>
                                </term>
                              </expression>
                              <symbol > ; </symbol>
                            </letStatement>
                          </statements>
                          <symbol > } </symbol>
                        </ifStatement>
                      </statements>
                      <symbol > } </symbol>
                    </ifStatement>
                    <letStatement>
                      <keyword > let </keyword>
                      <identifier name=batWidth type=int kind=Field index=6 used> batWidth </identifier>
                      <symbol > = </symbol>
                      <expression>
                        <term>
                          <identifier name=batWidth type=int kind=Field index=6 used> batWidth </identifier>
                        </term>
                        <symbol > - </symbol>
                        <term>
                          <integerConstant > 2 </integerConstant>
                        </term>
                      </expression>
                      <symbol > ; </symbol>
                    </letStatement>
                    <doStatement>
                      <keyword > do </keyword>
                      <identifier class, used> bat </identifier>
                      <symbol > . </symbol>
                      <identifier function, used> setWidth </identifier>
                      <symbol > ( </symbol>
                      <symbol > ) </symbol>
                      <symbol > ; </symbol>
                    </doStatement>
                    <letStatement>
                      <keyword > let </keyword>
                      <identifier name=score type=int kind=Field index=4 used> score </identifier>
                      <symbol > = </symbol>
                      <expression>
                        <term>
                          <identifier name=score type=int kind=Field index=4 used> score </identifier>
                        </term>
                        <symbol > + </symbol>
                        <term>
                          <integerConstant > 1 </integerConstant>
                        </term>
                      </expression>
                      <symbol > ; </symbol>
                    </letStatement>
                    <doStatement>
                      <keyword > do </keyword>
                      <identifier class, used> Output </identifier>
                      <symbol > . </symbol>
                      <identifier function, used> moveCursor </identifier>
                      <symbol > ( </symbol>
                      <symbol > ) </symbol>
                      <symbol > ; </symbol>
                    </doStatement>
                    <doStatement>
                      <keyword > do </keyword>
                      <identifier class, used> Output </identifier>
                      <symbol > . </symbol>
                      <identifier function, used> printInt </identifier>
                      <symbol > ( </symbol>
                      <symbol > ) </symbol>
                      <symbol > ; </symbol>
                    </doStatement>
                  </statements>
                  <symbol > } </symbol>
                </ifStatement>
              </statements>
              <symbol > } </symbol>
            </ifStatement>
            <doStatement>
              <keyword > do </keyword>
              <identifier class, used> ball </identifier>
              <symbol > . </symbol>
              <identifier function, used> bounce </identifier>
              <symbol > ( </symbol>
              <symbol > ) </symbol>
              <symbol > ; </symbol>
            </doStatement>
          </statements>
          <symbol > } </symbol>
        </ifStatement>
        <returnStatement>
          <keyword > return </keyword>
          <symbol > ; </symbol>
        </returnStatement>
      </statements>
      <symbol > } </symbol>
    </subroutineBody>
  </subroutineDec>
  <symbol > } </symbol>
</class>
