Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Untitled

a guest Apr 8th, 2020 145 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import canvas
  2. import time
  3. from random import randint
  4.  
  5. circles = []
  6. for i in range(5):
  7.     new_dict = {"x" : randint(20,330),
  8.     "y" : randint(20,330),
  9.     "dx" : randint (5,-5),
  10.     "dy" : randint(5,-5)}
  11.     circles.append(new_dict)
  12.     while True:
  13.         canvas.clear()
  14.         for g in circles:
  15.             new_dict["x"] = new_dict["x"] + new_dict["dx"]
  16.             new_dict["y"] = new_dict["y"] + new_dict["dy"]
  17.             if new_dict["x"] > 330 or new_dict["x"] < 20:
  18.                 new_dict["dx"] = -new_dict["dx"]
  19.             elif new_dict["y"] > 330 or new_dict["y"] < 20:
  20.              new_dict["dy"] = -new_dict["dy"]
  21.         else:
  22.             pass
  23.         canvas.circle(new_dict["x"], new_dict["y"], 20)
  24.         canvas.draw()
  25.         time.sleep(0.01)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top