kburnik

Logo - Zadatak: mreža mnogokuta

Dec 11th, 2012
84
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. to mreza :r :s :n :d
  2. ;; prvi dio : trazi dimenzije kutije (pravokutnika u koji stane mnogokut)
  3. pu home pd
  4.  
  5. make "xmin xcor
  6. make "ymin ycor
  7. make "xmax xcor
  8. make "ymax ycor
  9.  
  10. rt 90 pu
  11. repeat :n [
  12. fd :d lt 360/:n
  13. if xcor < :xmin [make "xmin xcor]
  14. if ycor < :ymin [make "ymin ycor]
  15. if xcor > :xmax [make "xmax xcor]
  16. if ycor > :ymax [make "ymax ycor]
  17. ]
  18. lt 90 pd
  19.  
  20. make "w :xmax - :xmin
  21. make "h :ymax - :ymin
  22.  
  23. ;; drugi dio : pomicemo se na pocetnu tocku crtanja
  24. ;; kako bi cijela slika bila centrirana
  25.  
  26. pu bk (:h*:r)/2 rt 90
  27. bk (:w*:s)/2 + :xmin
  28. lt 90 pd
  29.  
  30. ;; treci dio :: crtamo mrežu na klasični način
  31. repeat :s [
  32. repeat :r [
  33. rt 90 repeat :n [fd :d lt 360/:n] lt 90
  34. pu fd :h pd
  35. ]
  36. pu bk :r * :h
  37. rt 90 fd :w lt 90 pd
  38. ]
  39.  
  40.  
  41. end
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×