标签:style led tdd pre code abs div position nbsp
1 import stddraw 2 3 stddraw.setXscale(-1, 1) 4 stddraw.setYscale(-1, 1) 5 6 DT = 20.0 7 RADIUS = 0.05 8 rx = 0.480 9 ry = 0.860 10 vx = 0.015 11 vy = 0.023 12 while True: 13 #Update ball position and draw it there. 14 if abs(rx + vx) + RADIUS > 1.0: 15 vx = -vx 16 if abs(ry + vy) + RADIUS > 1.0: 17 vy = -vy 18 rx = rx + vx 19 ry = ry + vy 20 stddraw.clear(stddraw.GRAY) 21 stddraw.filledCircle(rx, ry, RADIUS) 22 stddraw.show(DT)
标签:style led tdd pre code abs div position nbsp
原文地址:http://www.cnblogs.com/cdf4745/p/7282661.html