of length ""first define some standard values self win win save this for drawing pips later self background "whitecolor of die face self foreground "blackcolor of the pips self psize size radius of each pip hsize size half the size of the die offset hsize distance from center to outer pips create square for the face cxcy center getx()center gety( point(cx-hsizecy-hsizep point(cx+hsizecy+hsizerect rectangle( , rect draw(winrect setfill(self backgroundcreate circles for standard pip locations self pip self __makepip(cx-offsetcy-offsetself pip self __makepip(cx-offsetcyself pip self __makepip(cx-offsetcy+offsetself pip self __makepip(cxcyself pip self __makepip(cx+offsetcy-offsetself pip self __makepip(cx+offsetcyself pip self __makepip(cx+offsetcy+offsetdraw an initial value self setvalue( def __makepip(selfxy)"internal helper method to draw pip at ( , )pip circle(point( , )self psizepip setfill(self backgroundpip setoutline(self backgroundpip draw(self winreturn pip def setvalue(selfvalue)"set this die to display value turn all pips off self pip setfill(self background