Recently I've faced a problem in MSWLogo, which I'd like to clarify.
Would you please help me.
I wanted to put a dot on the screen and for that purpose I used FD 1
BK 1. Sure, it wasn't actually a dot, but a little stroke. Following
Yehuda's suggestion, I changed these instructions with FD 0. After
that the turtle wouldn't leave any trace until I have enlarged the
pensize. That is, with the pensize [2 2] FD 0 works and with the pensize [1
1] it doesn't work.
What follow are the full set of codes (improved by Yehuda Katz in
compare with my initial solution) where this problem occurred. I
think it (I mean the set, but may be the problem also) would be of interest to logo fans. The procedures draw a
family of curves known in Mathematics as "roses".
----------------------------
to roses :a :k :coord
setpensize [2 2]
setpencolor [0 0 255]
ht
roses.draw 0
end
to roses.draw :fi
pu
setpos :coord
seth :fi fd roses.ro pd FD 0
; FD 0 HERE DOESN'T LEAVE A DOT WHEN PENSIZE [1 1]
test and (pos=se first :coord (last :coord)+:a)(:fi>0)
iff [roses.draw :fi+.5]
end
to roses.ro
op :a*(cos :k*:fi)
end
---------------------------------------------
roses is the main procedure. It's inputs:
:a - 'radius' of the rose;
:coord - the list of the coordinates of the centre of the rose, it
allows to draw several different roses on the same
screen;
:k - parameter, which regulates the number and the shape of the rose's
leaves;
it's interesting to investigate the cases:
:k - odd,
:k - even,
:k - rational,
:k - irrational.
So, one may try
roses 100 sqrt 2 [0 0]
or roses 50 2/5 [100 100]
or roses 100 6 [-100 -100] and so on.
----------------------------------------------------------------
Thank you.
Olga Tuzova.
---------------------------------------------------------------
Please post messages to the Logo forum to logo-l@gsn.org. Mail
questions about the list administration to logofdn@gsn.org. To
unsubscribe send unsubscribe logo-l to majordomo@gsn.org.