1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| #!/usr/bin/env python3
# coding: utf-8
import turtle
import random
def placePoint(height, width):
x=random.randint(-height//3, height//3)
y=random.randint(-width//3, width//3)
turtle.up()
turtle.goto(x, y)
turtle.write("P")
turtle.goto(0, 0)
return(x, y)
# placePoint()
def distance(P, T):
return (P[0] - T[0]) ** 2 + (P[1] - T[1]) ** 2
def cherche(height, width, P, *, step, calcD): pass
if __name__ == "__main__":
(height, width)=(800, 800)
P=placePoint(height, width)
print(P)
turtle.exitonclick()
# if |