My experience with turtle graphics in a
CS1 course has been very rewarding. It allows *everyone*, not just the most motivated, to be creative. With
turtle, drawing an original and intersting design is so easy. In a couple of dozens
of lines, my CS1 students create some amazing designs – every semester
brings more and more gems. Students use turtle to draw fractals and then concentric
figures that change colors and are constantly redrawn. Of course, turtle is not fast and it is
not fancy as programming, and it behaves badly in Windows, but the important
thing is that it really inspires almost all beginners to learn and do more. My students
post their turtle graphics designs in course Forums and they are so proud –
for good reason. Consider for example this simple program: # Pattern Designer import turtle; # Create a blue pen and determine the
window's width and height: def init(): pen = turtle.Pen(); pen.color(0, 0, 1); # blue width = pen.window_width(); height = pen.window_height(); return pen, width, height; # Given a number, design a pattern for
that number: def pattern(number): pen, w, h = init(); # Switch off tracing for higher speed: pen.tracer(False); for x in range(-w/2, +w/2): for y in range (-h/2, +h/2): draw(pen, number, x, y); # Temporarily switch on tracing to
observe drawing: if (x % 100 == 0): pen.tracer(True);
pen.tracer(False); pen.tracer(True); # Draw a pattern element at point (x, y): def draw(pen, number, x, y): a = y * (number / 100.0); b = x * (number / 100.0); ez = int(a*a*a + b*b*b); # Try ez = int(a*a + b*b) and other expressions. if (ez % 2 == 0): pen.up(); pen.goto(x, y);
pen.down(); pen.circle(1); # Draw pattern #5 pattern(5); # The above program is a framework to design
original patterns that are different form anything else – just by playing
with the draw function above. Change the _expression_ that defines ez, use random
numbers for colors, etc. The opportunities for creative designs are unlimited. Of course the above program is slow. But
it delivers exciting designs and inspires people. This is what matters,
particularly in CS1. Certainly, one can use more realistic
platforms, such as VPython, but then the complexity will probably kill the
enthusiasm. This is why I am interested in the turtle
module and its improvement. (Thank you again, Vern.) Atanas Atanas
Radenski I find
television very educating. Every time somebody turns on the set, I go into the
other room and read a book - Groucho Marx From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of kirby urner On 2/28/06, Toby Donaldson
<[EMAIL PROTECTED]> wrote:
|
_______________________________________________ Edu-sig mailing list Edu-sig@python.org http://mail.python.org/mailman/listinfo/edu-sig