MCPcopy Index your code
hub / github.com/python/cpython / coords

Method coords

Lib/turtledemo/nim.py:102–106  ·  view source on GitHub ↗
(self, row, col)

Source from the content-addressed store, hash-verified

100 self.showturtle()
101
102 def coords(self, row, col):
103 packet, remainder = divmod(col, 5)
104 x = (3 + 11 * packet + 2 * remainder) * WUNIT
105 y = (2 + 3 * row) * HUNIT
106 return x - SCREENWIDTH // 2 + WUNIT // 2, SCREENHEIGHT // 2 - y - HUNIT // 2
107
108 def makemove(self, x, y):
109 if self.game.state != Nim.RUNNING:

Callers 13

__init__Method · 0.95
_drawpolyMethod · 0.45
_drawlineMethod · 0.45
_drawimageMethod · 0.45
_pointlistMethod · 0.45
_rescaleMethod · 0.45
test_create_rectangleMethod · 0.45
test_create_lineMethod · 0.45
test_create_polygonMethod · 0.45
test_coordsMethod · 0.45
test_horizontal_rangeMethod · 0.45
test_variable_changeMethod · 0.45

Calls

no outgoing calls

Tested by 7

test_create_rectangleMethod · 0.36
test_create_lineMethod · 0.36
test_create_polygonMethod · 0.36
test_coordsMethod · 0.36
test_horizontal_rangeMethod · 0.36
test_variable_changeMethod · 0.36
test_resizeMethod · 0.36