kburnik

Logo - Zadatak Kovanice

Feb 19th, 2013
47
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. to kovanice :n :a :b :d
  2. ; glavni program
  3. ( local "velicine "kovanice "r )
  4. make "velicine (list :a (:a+:b) 0 0 (:a+2*:b) )
  5. make "kovanice rasporedi :n
  6.  
  7. foreach :kovanice [
  8. make "r item (item # :kovanice) :velicine
  9. novcic :r :d
  10. pu fd :d pd
  11. ]
  12.  
  13. end
  14.  
  15. to rasporedi :n
  16. ; rasporedi :n na petice, dvice i jedinice
  17. ( local "petice "dvice "jedinice "l )
  18. make "petice int (:n/5)
  19. make "dvice int ((:n-:petice*5)/2)
  20. make "jedinice (:n-:petice*5-:dvice*2)
  21.  
  22. make "l []
  23. repeat :petice [make "l lput 5 :l]
  24. repeat :dvice [make "l lput 2 :l ]
  25. repeat :jedinice [make "l lput 1 :l ]
  26. op :l
  27. end
  28.  
  29. to novcic :r :d
  30. ; crtanje jednog novcica s brisanjem pozadine
  31. ( local "p )
  32. polukrug :r :d make "p pos
  33. pu lt 90 fd :r rt 90 pd fd :d
  34. pu setpos :p
  35. rt 90 fd :r lt 90 pd fd :d
  36. pu setpos :p fd :d pd
  37. krug :r
  38. pu setpos :p pd
  39.  
  40. end
  41.  
  42. to krug :r
  43. ; prebrisi oblik kruga :r i nacrtaj kruznicu :r
  44. setcolors [254 254 254] circle :r (fill "true)
  45. setcolors [255 255 255] fill
  46. setcolors [0 0 0] circle :r
  47.  
  48. end
  49.  
  50.  
  51.  
  52. to polukrug :r :d
  53. ; prebrisi oblik slova u visine linija :d i nacrtaj polukrug :r
  54. ( local "p )
  55. make "p pos
  56. setcolors [254 254 254]
  57. lt 90 arc 180 :r pu fd :r rt 90 pd fd :d rt 90 fd :r*2 rt 90 fd :d rt 180
  58. pu setpos :p
  59. pu bk :r/2
  60.  
  61. pd (fill "true) pu fd :r/2 pd
  62. setcolors [255 255 255] fill
  63. setcolors [0 0 0] lt 90 arc 180 :r rt 90
  64.  
  65. end
  66.  
  67.  
  68.  
  69. to setcolors :color
  70. ; postavi iste boje :color crtanja i ispunjavanja
  71. setpc :color setfc :color
  72. 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.

×