Ńņ VHc@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((s TicTacToe4.pytdrawGrids0cCs%tt|tdt|tdƒS(scoordinates of center of squarei(RR(trowtcol((s TicTacToe4.pyt rectCenterscCstt|tt|tƒS(s'coordinates of top left of inset X or O(RRtINSET(R R ((s TicTacToe4.pyt rectUpperLeftscCs%tt|dtt|dtƒS(s+coordinates of bottom right of inset X or Oi(RRR(R R ((s TicTacToe4.pytrectLowerRightscCs!tt|dtt|tƒS(s(coordinates of top right of inset X or Oi(RRR(R R ((s TicTacToe4.pytrectUpperRight"scCs!tt|tt|dtƒS(s*coordinates of bottom left of inset X or Oi(RRR(R R ((s TicTacToe4.pyt rectLowerLeft&scCsTtt||ƒt||ƒƒitƒtt||ƒt||ƒƒitƒdS(sDraw an X in the given squareN(RRRRRRR(R R ((s TicTacToe4.pytdrawX,s(cCs+tt||ƒtdtƒitƒdS(sDraw an O in the given squareiN(tCircleR RRRR(R R ((s TicTacToe4.pytdrawO1scCs|tS(sFFind out row or colum number that corresponds to this pixel coordinate(R(t pixelCoord((s 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 ((s TicTacToe4.pytmain>s      % (t zellegraphicsR!RRRRRRtNoneRR R RRRRRRR RR'(((s TicTacToe4.pyts&