""" 正弦与四舍五入彩点实验.py """ import math from sprites import * screen = Screen() screen.tracer(0,0) bug = Sprite(visible=False) while True: bug.gotorandom() x = bug.xcor() y = bug.ycor() b1 = round(math.sin(math.radians(x))) b2 = round(math.sin(math.radians(y))) if b1 == b2: bug.randomcolor() bug.dot(10) bug.update()
李兴球
李兴球的博客是Python创意编程原创博客