Posted By

maturanti19 on 05/22/19


Tagged

a siet ciary kvapky stvorcekova rozne


Versions (?)

Stvorcekova siet a kvapky random


 / Published in: Python
 

Vytvorte stvorcekovu siet a kvapky a rozne velke a dlhe ciary

  1. import tkinter
  2. from random import *
  3.  
  4. canvas = tkinter.Canvas(height=600, width=800, bg='gainsboro')
  5. canvas.pack()
  6.  
  7. for i in range (1,31):
  8. farba = ('skyblue')
  9. x=randrange(100,600)
  10. y=randrange(100,800)
  11. r=randrange(5,26)
  12. canvas.create_oval(x-r, y-r, x+r, y+r, fill=farba, outline='')
  13.  
  14. #
  15. z=50
  16. x=0
  17. for i in range (16):
  18. x=x+z
  19. canvas.create_line(x,0,x,600)
  20.  
  21. #
  22. z=50
  23. y=0
  24. for i in range (12):
  25. y=y+z
  26. canvas.create_line(0,y,800,y)
  27.  
  28. #
  29. a=30
  30. b=40
  31. x=110
  32. y=110
  33. for i in range (5):
  34. x=x+a
  35. y=y+b
  36. canvas.create_line(x+b,y+a,400+b,y+a, width=6, fill='gold')
  37. #
  38. a=30
  39. b=40
  40. y=100
  41. for i in range (5):
  42. canvas.create_line(210,y+a*i,500,z+b*i, width=5, fill='indigo')
  43.  
  44. #
  45. a=10
  46. b=40
  47. x=150
  48. y=350
  49. for i in range(5):
  50. x=x+b
  51. y=y+a
  52. canvas.create_line(x,y+a,x,y+b, width=5, fill='red')
  53.  
  54. #
  55. x=210
  56. y=510
  57. a=30
  58. b=25
  59. for i in range(5):
  60. canvas.create_line(x+b*i,y+b*i,x+b*i,310-a, width=5, fill='pink')

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: milessmith on May 27, 2019

Thanks for sharing.I found a lot of interesting information here. A really good post, very thankful and hopeful that you will write many more posts like this one. ucbrowser.vip shareit.onl mxplayer.pro

You need to login to post a comment.