Rice- IIIP (2)

来源:互联网 发布:js中json转数组 编辑:程序博客网 时间:2024/05/22 04:54

avoid unnamed constant

运行

在codesculptor直接运行

Mac:
Alt-Left/Right
Windows:
Ctrl-Left/Right
move by word

selecting line
shift+down

使用取模可以防止出边界

self.pos[0] = (self.pos[0]+ \ self.vel[0]) % WIDTHself.pos[1] = (self.pos[1]+ \ self.vel[1]) % HEIGHT
0 0