Advertisement
kburnik

Logo - Zadatak Popuni

Feb 23rd, 2013
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. ;; Popuniti područje kružnice kvadratima
  2. ;; Autor: Kristijan Burnik
  3.  
  4. to crtaj :s :r :n :t :a :b
  5. (local "d "c "dija "p "t1 "t2 "h )
  6. if :n = 0 [stop]
  7.  
  8.  
  9. pu
  10. setpos :t
  11. make "h heading
  12. seth :h+45
  13. make "dija 0
  14.  
  15. while [ (distance :s) < (:r-1) ] [
  16. make "dija :dija + 1 fd 1
  17. ]
  18.  
  19. pd
  20. pu setpos :t pd
  21. make "d :dija/(sqrt 2)
  22. seth :h
  23. pd
  24. fd :d rt 90 make "t1 pos
  25. fd :d rt 90 make "c pos
  26. fd :d rt 90 make "t2 pos
  27. fd :d rt 90
  28.  
  29. crtaj :s :r (:n-1) :t1 :a :c
  30. crtaj :s :r (:n-1) :t2 :c :b
  31.  
  32. pu setpos :s pd
  33. end
  34.  
  35. to popuni :r :n
  36. (local "a "b)
  37.  
  38. circle :r
  39. pu fd :r make "a pos bk :r rt 90 fd :r make "b pos bk :r pd lt 90
  40.  
  41. repeat 4 [
  42. crtaj pos :r :n pos :a :b
  43. rt 90
  44. ]
  45. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement