kburnik

LOGO - Silba 2012 - Zadatak: Poligon :: Kristijan Burnik

Aug 22nd, 2012
60
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. to drawpoli
  2. make "l []
  3. mouseon [
  4. make "l lput mousepos :l
  5. ][][mouseoff cs poligon :l][][
  6. cs
  7. if (count :l) > 0 [
  8. pu setpos first :l pd
  9. foreach :l [setpos ?]
  10. setpos mousepos
  11. ]
  12.  
  13. ]
  14.  
  15. end
  16.  
  17. to poligon :l
  18. (local "h "kh "kut "nh "tip)
  19. if (count :l) < 2 [stop]
  20. make "l (se :l list (first :l) (item 2 :l))
  21. pu setpos first :l
  22. seth towards first :l pd
  23.  
  24. make "tip "konveksni
  25. foreach :l [
  26. make "nh int (towards ?)
  27. make "kut 0
  28. make "h int heading
  29. make "kh :h
  30. seth towards ?
  31. while [not (:kh = :nh)] [
  32. make "kut :kut + 1
  33. make "kh remainder (:h + :kut) 360
  34. ]
  35. if :kut > 180 [circle 10 make "tip "konkavni]
  36. setpos ?
  37. ]
  38. pr :tip
  39. 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.

×