³ņ ö{Gc@sµddkTddkZdaetƒadZetadZda d„Z d„Z d„Z d „Z d „Zd „Zd „Zd „ZeegZd„Zd„ZeƒdS(i’’’’(t*Nii–icCs~xwtdtƒD]f}ttd|tƒtt|tƒƒitƒtt|tdƒt|ttƒƒitƒqWdS(Nii(tranget BOARDSIZEtLinetPointtPPSt WINDOWSIZEtdrawtwin(ti((sDD:\rep\120python\CatapultMaterials\Exercises\TicTacToe\TicTacToe4.pytdrawGrids0cCs%tt|tdt|tdƒS(scoordinates of center of squarei(RR(trowtcol((sDD:\rep\120python\CatapultMaterials\Exercises\TicTacToe\TicTacToe4.pyt rectCenterscCstt|tt|tƒS(s'coordinates of top left of inset X or O(RRtINSET(R R ((sDD:\rep\120python\CatapultMaterials\Exercises\TicTacToe\TicTacToe4.pyt rectUpperLeftscCs%tt|dtt|dtƒS(s+coordinates of bottom right of inset X or Oi(RRR(R R ((sDD:\rep\120python\CatapultMaterials\Exercises\TicTacToe\TicTacToe4.pytrectLowerRightscCs!tt|dtt|tƒS(s(coordinates of top right of inset X or Oi(RRR(R R ((sDD:\rep\120python\CatapultMaterials\Exercises\TicTacToe\TicTacToe4.pytrectUpperRight"scCs!tt|tt|dtƒS(s*coordinates of bottom left of inset X or Oi(RRR(R R ((sDD:\rep\120python\CatapultMaterials\Exercises\TicTacToe\TicTacToe4.pyt rectLowerLeft&scCsTtt||ƒt||ƒƒitƒtt||ƒt||ƒƒitƒdS(sDraw an X in the given squareN(RRRRRRR(R R ((sDD:\rep\120python\CatapultMaterials\Exercises\TicTacToe\TicTacToe4.pytdrawX,s(cCs+tt||ƒtdtƒitƒdS(sDraw an O in the given squareiN(tCircleR RRRR(R R ((sDD:\rep\120python\CatapultMaterials\Exercises\TicTacToe\TicTacToe4.pytdrawO1scCs|tS(sFFind out row or colum number that corresponds to this pixel coordinate(R(t pixelCoord((sDD:\rep\120python\CatapultMaterials\Exercises\TicTacToe\TicTacToe4.pyt boardCoord9scCsātdƒ}|djo&t|ƒattƒattantdttƒat ƒd}xf|ttjoTti ƒ}t |i ƒƒt |i ƒƒ}}t|d||ƒ|d}qaWtidƒtiƒdS(Ns&Enter board size (Press Enter for 3): tsTicTacToe version 4iiii(t raw_inputtevalRRt BOARDRANGERRtGraphWinRR tgetMouseRtgetYtgetXtdrawListttimetsleeptclose(tuserSizet turnCountt clickPointR R ((sDD:\rep\120python\CatapultMaterials\Exercises\TicTacToe\TicTacToe4.pytmain>s     % (t zellegraphicsR!RRRRRRtNoneRR R RRRRRRR RR'(((sDD:\rep\120python\CatapultMaterials\Exercises\TicTacToe\TicTacToe4.pyss&