[Edu-sig] teaching python using turtle module
Daniel Ajoy
da.ajoy at gmail.com
Wed Dec 2 17:10:20 CET 2009
Re: teaching python using turtle module
Posted by: "Pavel Boytchev" elicateam
To: LogoForum at yahoogroups.com
Tue Dec 1, 2009 9:39 am (PST)
Daniel Ajoy wrote:
> On Tue, 01 Dec 2009 06:00:01 -0500, <edu-sig-request at python.org> wrote:
>
>>> examples which use turtle with conditional structures (if- and while-
>>> statements)
Here is one with IF and WHILE:
1. draw a box
2. put a turtle inside, set random heading
3. move the turtle forward until it reaches a box's side
4. then the turtle bounces like a ball and continues to move
5. stop after 5 bounces
------------------------
Another one with WHILE:
1. two turtles are on a circle and move along it with different speeds
2. animate the chase until one of the turtle reaches the other
------------------------
Another one with IF:
1. draw the snowflake fractal
2. but when you draw recursively, draw either to the left of the current
segment, or to the right
------------------------
Another one with WHILE and IF:
1. Use a turtle and the Monte-Carlo method to calculate pi with given
precision
------------------------
With IF:
1. draw a Pythagorean tree until branches become smaller than 1 pixel
------------------------
Pavel
More information about the Edu-sig
mailing list