On Mon, 25 Jan 2010 06:00:01 -0500, <edu-sig-requ...@python.org> wrote:

> I'm almost sure that there's no way for a turtle to know anything
> about the background.  That's an unfortunate limitation!

In FMSLogo:

PIXEL

Description
Outputs a three element list of numbers that represent the red, green, and blue 
intensity of the pixel currently under the turtle.


> As for putting a limit on a turtle's travel, you need to write an
> appropriate conditional.  For example, if you want your turtle to stay
> within a 200x200 square centered around the origin and stop if it gets
> out, do something roughly like:
> 
> while(math.abs(t.xcor()) < 100 and math.abs(t.ycor()) < 100):
>    move turtle
> 
> Of course, you could instead use if statements and simulate bouncing
> (if my turtle's x coordinate is beyond my bounding box, subtract from
> its x coordinate).


In FMSLogo:

WINDOW

Description
Tells the turtle to enter "window" mode. From now on, if the turtle is asked to 
move past the boundary of the graphics window, it will move off screen. The 
visible graphics window is considered as just part of an infinite graphics 
plane; the turtle can be anywhere on the plane.

WRAP

Description
Tells the turtle to enter "wrap" mode. From now on, if the turtle is asked to 
move past the boundary of the graphics window, it will "wrap around" and 
reappear at the opposite edge of the window. The top edge wraps to the bottom 
edge, while the left edge wraps to the right edge. (So the window is 
topologically equivalent to a torus.) This is the turtle's initial mode. 


FENCE
Description
Tells the turtle to enter "fence" mode. From now on, if the turtle is asked to 
move past the boundary of the graphics window, it will move as far as it can 
and then stop at the edge with an "out of bounds" error message. 

Daniel
http://sourceforge.net/projects/fmslogo/files/

_______________________________________________
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig

Reply via email to