[Edu-sig] experiences teaching Python with turtle graphics?

Brad Miller bmiller at LUTHER.EDU
Fri Nov 17 18:32:59 CET 2006


On Nov 17, 2006, at 8:42 AM, John Zelle wrote:

> On Friday 17 November 2006 8:07 am, Ernesto Costa wrote:
>> Hi,
>>
>> Returning to the question of a "good" module about graphics. I'm
>> using Zohn Zelle's book for my course. It has a interesting and
>> simple to use graphics module. It would be nice if that module could
>> be "merged" with xturtle i.e to incorporate a turtle class that use
>> the graphics canvas :-)!
>>
>
> One project that we often use in my classes is writing a simple  
> turtle module
> on top of graphics.py. It's a great exercise for introducing  
> students to
> writing their own classes. Still, I have to say that xturtle looks  
> very
> interesting, and this might be a great combination. I haven't  
> looked at
> xturtle's implementation in any detail, so I don't have any sense  
> on how hard
> such a merger would be.
>
> --John
>

Hi,

I've been using Gregor's xturtle in my CS 1 class this fall, along  
with John's CS1 text.  Although this is a college course the students  
do not have any prior programming experience.

I have found that it is a really nice way to introduce students to  
the concept of using an object.   Creating instances, calling methods  
etc.   We have used xturtle for several projects including:

- drawing a sierpinski triangle

- drawing simple scenes

- plotting simple functions  I extended xturtle to have a  
setWorldCoordinates method that works like the like the  
setWorldCoords method in John's graphics.py.  After we do the scaling  
and translation for ourselves once, its nice to let the system do it  
for us the rest of the time.

- "bouncing turtles"  moving multiple turtles around a box, bouncing  
off the walls and other turtles

- classic video game  xturtle has an onClick, onTimer, and onKey  
function that lets you setup callbacks for those three event types.   
Using a turtle or turtles as a sprite the students were able to make  
some really fun classic games like pong, space invaders, asteroids

Now, we are learning how to write our own classes and we are  
implementing a set of classes that look like the those defined in  
graphics.py.  Behind the scenes we are using xturtle to create the  
window and do the real drawing.  I have used graphics.py in past  
years to build a turtle, so this year we are doing the opposite.  So  
far I like doing it this way because graphics is such a natural  
object oriented application and the inheritance hierarchy for shapes  
is such a nice one.

I also like using turtle graphics when I'm teaching recursion.

Brad


>
> -- 
> John M. Zelle, Ph.D.             Wartburg College
> Professor of Computer Science    Waverly, IA
> john.zelle at wartburg.edu          (319) 352-8360
> _______________________________________________
> Edu-sig mailing list
> Edu-sig at python.org
> http://mail.python.org/mailman/listinfo/edu-sig

Bradley Miller
Assistant Professor Computer Science
Luther College
Decorah, IA  52101
http://www.cs.luther.edu/~bmiller




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/edu-sig/attachments/20061117/1cf0a798/attachment.html 


More information about the Edu-sig mailing list