Environment:
Python 2.2.1 on Windows
Bug fixes:
There is no output without tracing, i.e. with tracer(0)
the module not update the canvas. Fixed in _draw_turtle
and circle. Now after tracer(0) the head turns off
immediatly, all drawing functions working as required
without tracer mode. A few duplicates elimineted in
_goto to clean up the code. Cosmetic changes with
adding and removing empty lines.
New functions:
heading(): returns the current heading of the pen
setheading(angle): sets the heading of the pen
position(): returns the current position, later you can
reuse it with goto()
window_width(): returns the width of the window in pixels
window_height(): returns the height of the window in pixels
setx(xpos): moves the pen such that its y-position
remains the same but its x-position is the given value.
The heading of the pen is not changed. If the pen is
currently down,it will draw a line along its path.
sety(ypos): moves the pen such that its x-position
remains the same but its y-position is the given value.
The heading of the pen is not changed. If the pen is
currently down, it will draw a line along its path.
With these changes the turtle module maintains better
funcionality with Logo turtle graphics.
|