Advertisement
Guest User

testishe

a guest
Dec 9th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.63 KB | None | 0 0
  1. import simple_draw as sd
  2.  
  3. M, X, Y, W, H = int(input('M=')), int(input('X=')), int(input('Y=')), int(input('W=')), int(input('H='))
  4. sd.resolution = (50 + W + X, 50 + H + Y)
  5.  
  6. for y in range(0, 600, M):
  7.     y2 = y + M
  8.     x = 0
  9.     lp_point = sd.get_point(x, y)
  10.     for x in range(0, 600, M):
  11.         x2 = x + M
  12.         rt_point = sd.get_point(x2, y2)
  13.         sd.rectangle(left_bottom=lp_point, right_top=rt_point, color=sd.COLOR_RED, width=1)
  14.  
  15. sd.rectangle(left_bottom=sd.get_point(X, Y), right_top=sd.get_point(W + X, H + Y), color=sd.COLOR_GREEN, width=4)
  16. sd.pause()
  17.  
  18. hm = int((H + M) / M)
  19. wm = int((W + M) / M)
  20.  
  21. print(hm * wm)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement