# random rectangle # modify from http://mtg.lcc.gatech.edu/class/rectangles.py from appuifw import * import e32 from random import randrange running = 1 def quit(): global running running = 0 app.exit_key_handler = quit app.screen = 'large' app.body = canvas = Canvas() res_x, res_y = canvas.size while running: x1 = randrange(res_x) x2 = randrange(x1, res_x) y1 = randrange(res_y) y2 = randrange(y1, res_y) color = randrange(0xffffff) canvas.rectangle((x1, y1, x2, y2), fill=color) e32.ao_yield()
You need to create an account or log in to post comments to this site.