Posted By

maturanti19 on 05/22/19


Tagged

s domcek krizikom


Versions (?)

Domceky s krizikom vstrede tesne vedla seba dookola vsade


 / Published in: Python
 

Vytvor domcek ktory bude tesne vedla seba ako ulica alebo dedina

  1. import tkinter
  2. from random import *
  3.  
  4. canvas = tkinter.Canvas(height=800, width=800, bg='gainsboro')
  5. canvas.pack()
  6.  
  7. def house():
  8. canvas.create_line(x,y,x,y-100,x,y-100,x+100,y-100,x+100,y-100,x+100,y-100,x+100,y,x+100,y,x,y-100,x,y-100,x+100,y-100,x+100,y-100,x,y-100,x+50,y-150,x+50,y-150,x+100,y-100,x+100,y-100,x,y,x,y,x+100,y, fill='blue',width=3)
  9.  
  10. x=10
  11. y=155
  12. for i in range(1,6):
  13. house()
  14. x=x+110
  15.  
  16. x=10
  17. y=155
  18. for i in range(1,6):
  19. house()
  20. y=y+160
  21.  
  22.  
  23. for i in range(10):
  24. x=randrange(300,800)
  25. y=randrange(200,600)
  26. house()

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: milessmith on June 4, 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. kodi.software plex.software luckypatcher.pro

You need to login to post a comment.