[IAEP] turtle art clean request

Walter Bender walter.bender at gmail.com
Sat Sep 12 08:57:39 EDT 2009


Good point. I'll look into adding the new block (probably not until
after feature freeze, alas). In the meanwhile, you could try this code
loaded into the programmable brick (the one that loads Python code
from the journal):

    # clear canvas without reseting any turtle parameters
    rect = gtk.gdk.Rectangle(0,0,lc.tw.turtle.width,lc.tw.turtle.height)
    lc.tw.turtle.gc.set_foreground(lc.tw.bgcolor)
    lc.tw.turtle.canvas.image.draw_rectangle(lc.tw.turtle.gc, True, *rect)
    invalt(lc.tw.turtle,0,0,lc.tw.turtle.width,lc.tw.turtle.height)
    return

One thought I had is to make the clean brick just clear the screen
(and stop any media that is playing) and let the start brick do the
reset. I wonder how many TA programs would break? (And I would have to
make the start brick be able to be connected in line. Currently it
only can be positioned at the top of a pile.)

-walter


On Sat, Sep 12, 2009 at 2:57 AM, Bill Kerr <billkerr at gmail.com> wrote:
> it would be good to have a tile that only cleaned the graphics and kept the
> other setting such as current pen thickness, colour, turtle position,
> heading etc
> logowriter had a
> rg reset graphics which acted like the TA clean
> and a
> clean which acted like I'm suggesting in my first line, other settings not
> being reset
> for example
> I wanted to write a procedure that showed the number of the colour as the
> colour changed by changing the heading, for instance
> I can do that but it would be much easier and initially more understandable
> for students if there was a clean that kept other settings
> it would even better still if there was a separate way to erase show while
> the procedure was running
> ( I haven't looked at the python yet )
> How to do it with the current TA
> store in box1: 0
> repeat 90
>  setpensize 10
>  right box1
>  set color heading
>  show heading
>  forward 100
>  back 100
>  wait 10
>  store in box1: box1 + 1
>  clean (everything resets)
> How to do it with a clean that cleans graphics but keeps other settings:
>  setpensize 10
> repeat 90
>   forward 100
>   back 100
>   right 1
>   set color heading
>   show heading
>   wait 10
>   clean (only the graphics are cleaned)
> The ability to see how heading works concretely in action and to program
> this fairly easily would make a difference as to the percentage of students
> who grasp the concept
> Actually for a while there I thought that setpensize was broken because I
> didn't realise that clean was a total reset
>
>
> _______________________________________________
> IAEP -- It's An Education Project (not a laptop project!)
> IAEP at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/iaep
>



-- 
Walter Bender
Sugar Labs
http://www.sugarlabs.org


More information about the IAEP mailing list