experiences teaching Python with turtle graphics?

In a few weeks I am going to start the programming unit of my tenth grade computer applications course. This will be my 5th time through it, and the previous 4 times have been only partially satisfactory. The course I teach is required, and although the students are all fairly bright, they are not all enthusiastic about this kind of thing. We have about 4 weeks to spend on the programming portion. I've started with about 4 days of RUR-PLE, where students program a robot sprite to move around inside a maze. RUR-PLE is basically a Python version of Karl The Robot, with a nice interface and some very appealing graphics. This has worked out quite well as a starting point, and introduces some of the basic ideas of subroutines, branches, and loops in a constrained environment. I've found that students are quite surprised to see the kinds of complex behavior that can come from a few lines of code. My favorite student quote: "It's so logical, but so frustrating."
From there, they've gone on to using IDLE, writing the simple text-based "guess the number" sequence of programs that I've seen in several introductory books and the first chapter of the Livewires. This takes a few days, introducing variables and reiterating the looping and branching from RUR-PLE in a more free-form environment.
From there, they do some ultra-simple animation, using a loop with sleep() to move disks around and bounce them off the sides of the window, and
Then we've gone on to do some ultra-simple graphics, using the Livewires primitives to draw circles, lines, etc. This reiterates the subroutines from RUR-PLE, and introduces (with mixed results) return values and parameters. Then we do a little bit with lists - I have them generate random Shakepearean insults from lists of words. polling the keyboard to use cursor keys to move objects around on the screen. At this point, about a quarter of the kids are really into it, and they make a simple pong-like game. The other three quarters are dying for the unit to be over. One poster here several weeks ago said that 70% of the kids in their programming courses never really "get it" and unfortunately that's been my experience as well. I'd really like to do better. I'm particularly interested in using Gregor Lingl's xturtle library. I know that versions of turtle graphics have been around for various environments for a long time but I've only started to look at it, and it seems like it should be a lot of fun. More specifically, it seems like if it is used wisely, it should appeal to more of the kids for a longer period of time, and still provide a platform for getting across the concepts. Does anybody out there have any specific experience with teaching Python to this kind of audience using turtle graphics? Are there any books or lesson plans available that you can recommend as a starting point? As a point of reference, the first time I tried to teach Python I thought that the Livewires course would be perfect but I quickly found that, as slow and gentle as it seems to an experienced programmer, it moves way too fast and has way too little hand-holding for most high school kids. Thanks, Andy Judkis Academy of Allied Health and Science Neptune, NJ

Hi, I used xturtle in a CS1 course for students with little or no previous knowledge about programming. Of course they are not kids and so I use it just to illustrate some simple programming concepts. It is a nice tool but be prepared for some limitations (IMHO). In particular if you are thinking about applications where you have to input data it is just impossible (at least I could not find a way of doing it from the manual). Anyway you can do nice things with the onClick() and onKey() methods. Concerning books what I've done is to rely on the old, but very good book, by Abelson and diSessa "Turtle Geometry" (MIT Press) and translate the logo code to Python. There are other old books on Logo, including some with nice small programs, that you can also convert to Python. 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 :-)! Ernesto Costa On 2006/11/17, at 03:30, Andy Judkis wrote:
I'd really like to do better. I'm particularly interested in using Gregor Lingl's xturtle library. I know that versions of turtle graphics have been around for various environments for a long time but I've only started to look at it, and it seems like it should be a lot of fun. More specifically, it seems like if it is used wisely, it should appeal to more of the kids for a longer period of time, and still provide a platform for getting across the concepts.
Does anybody out there have any specific experience with teaching Python to this kind of audience using turtle graphics? Are there any books or lesson plans available that you can recommend as a starting point? As a point of reference, the first time I tried to teach Python I thought that the Livewires course would be perfect but I quickly found that, as slow and gentle as it seems to an experienced programmer, it moves way too fast and has way too little hand-holding for most high school kids.

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 -- John M. Zelle, Ph.D. Wartburg College Professor of Computer Science Waverly, IA john.zelle@wartburg.edu (319) 352-8360

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@wartburg.edu (319) 352-8360 _______________________________________________ Edu-sig mailing list Edu-sig@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
participants (4)
-
Andy Judkis
-
Brad Miller
-
Ernesto Costa
-
John Zelle