Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- to mreza :r :s :n :d
- ;; prvi dio : trazi dimenzije kutije (pravokutnika u koji stane mnogokut)
- pu home pd
- make "xmin xcor
- make "ymin ycor
- make "xmax xcor
- make "ymax ycor
- rt 90 pu
- repeat :n [
- fd :d lt 360/:n
- if xcor < :xmin [make "xmin xcor]
- if ycor < :ymin [make "ymin ycor]
- if xcor > :xmax [make "xmax xcor]
- if ycor > :ymax [make "ymax ycor]
- ]
- lt 90 pd
- make "w :xmax - :xmin
- make "h :ymax - :ymin
- ;; drugi dio : pomicemo se na pocetnu tocku crtanja
- ;; kako bi cijela slika bila centrirana
- pu bk (:h*:r)/2 rt 90
- bk (:w*:s)/2 + :xmin
- lt 90 pd
- ;; treci dio :: crtamo mrežu na klasični način
- repeat :s [
- repeat :r [
- rt 90 repeat :n [fd :d lt 360/:n] lt 90
- pu fd :h pd
- ]
- pu bk :r * :h
- rt 90 fd :w lt 90 pd
- ]
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement