[Home] [Back to Message Index]

Global SchoolNet - Automated Message Archive

Re: LOGO-L> Berkeley Logo




Brian Harvey (bh@CS.Berkeley.EDU)
Mon, 20 Jan 1997 12:25:44 -0800 (PST)

> Logo should really should use multiple
> pixels as the lowest resolution, so it has more room to maneuver.

Don't you mean that it should use fractions of a pixel? Using
multiple pixels would just make pictures more jagged than necessary.

Some versions of Logo do, in fact, use fractional pixels as the
unit of distance, but for a different reason: If you pick a
really small unit, you can do all the geometric calculations in
integer arithmetic, which makes drawing faster.

But I'm not convinced that that would really help with the
PENREVERSE problem; ultimately you have to reduce precision down
to what the hardware can draw, and you'd want to draw most of the
fractional-pixel units that make up the corner pixels anyway.

The MSWLogo approach has its own failure cases, I think. For
example, suppose we draw a square with the pen down (or reversing,
since it won't matter in MSWLogo):

repeat 4 [fd 100 rt 90]

Now suppose I want to un-draw the top edge. So I say

penup
fd 100 rt 90
penreverse ; or penerase -- I think it won't matter
fd 100

We are now left with a cup whose left edge is one pixel higher than
its right edge. That seems undesirable to me.

I can imagine a technique that would "do the right thing" in most
cases, but would be pretty hard to explain or model. It's this:
Logo can remember whether or not it has just drawn on the pixel
under the turtle's position. "Drawn" includes penpaint or penreverse,
even if the latter actually turned off the pixel. Then, whenever
you move in penreverse, if that flag is set you refrain from drawing
on the first pixel, but not otherwise.

Does anyone have a situation in which this wouldn't do what the user
wants? If not, I'll try it in Berkeley Logo.
---------------------------------------------------------------
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.