[MWForum]Re: MIA, Ask an Expert: colorunder?

Daniel Ajoy mwforum@lists.mathcats.com
Mon, 07 Mar 2005 17:44:29 -0500


> from: pinklamalord098@yahoo.com
> date: Fri, 4 Mar 2005 14:06:07 -0700
> 
> How do you makee a tutle react when it touches a certain
> color?  I think it's called the colorunder command how do
> you do that?

Hi pinklamalord098,

You could place this code in the instruction field of the
turtle and set it to "many times":

fd 1 if colorunder = 15 [announce "red stopall]



15 is the code number of "red".


Then you can replace this part

announce "red 

with whatever reaction you need.

Daniel
OpenWorld Learning