[MWForum]Help with Conditionals
Wendy Petti
mwforum@lists.mathcats.com
Tue, 18 May 2004 16:55:32 -0400
I have some additional ideas to consider, to add to Jeff's and Susan's
outstanding suggestions.
I wonder if it is possible that the wrong turtle is stopping, and you are
giving commands to a stationary turtle. You might consider being explicit
about which turtle should stop.
Please also be aware that STOP only stops the procedure in which it is
found. If you have set the turtle into motion through a different
procedure, that procedure will not stop. This is why STOPALL (placed
*after* the announcement) would be a more foolproof stopping command.
If you want to isolate the difficulty, temporarily have something else
happen instead of asking the turtle to stop. For instance, remove the STOP
command; is the announcement working? If so, then you know that the IF
command is checking properly for it has triggered the announcement. In this
case, the STOP command is ineffectual, perhaps for the reason I've
suggested. But if the announcement is not triggered, then the IF command
has not been checking continuously.
If you do not wish to run the procedure containing the IF command
continuously, you could also consider using WHEN instead of IF. The
structure is different so be sure to check the Help menu for details. IF
checks to see if the condition is true at one particular moment and then
stops checking; that is why you need to keep running the command. WHEN
keeps checking until the condition is true.
If you want to continue trying the colorunder method, be sure to
double-check the number of color over which the turtle will be passing. I
don't know why, but on some projects in the past I've used a standard color
to draw something but when I check its number later it might not be 35 but
instead 35.4 (or another decimal number).
Finally, if our collective advice has still not helped you to resolve the
problem, *please send us the project as an attachment!!* We might be able
to help you better if we can see exactly what is going on.
Good luck,
Wendy Petti
OpenWorld Learning
http://www.openworldlearning.org
OWL's MicroWorlds in Action
http://mia.openworldlearning.org
> -----Original Message-----
> From: mwforum-admin@lists.mathcats.com
> [mailto:mwforum-admin@lists.mathcats.com]On Behalf Of Susan Einhorn
> Sent: Tuesday, May 18, 2004 2:54 PM
> To: mwforum@lists.mathcats.com
> Subject: Re: [MWForum]Help with Conditionals
>
>
> On May 18 at 10:41 am, Mw. Jackson wrote:
>
>
> > I am in a real bind. I have introduced the conditional "if" to my 8th
> > grade class. We have a BIG integration product due by Thursday for a
> > Science/Tech Fair. The students are simulating their experience of
> > testing the velocity of water using oranges in a river. The orange
> > should stop either when it hits the rope or the girl shape.
> >
> > Okay, here is the problem.
> >
> > We wrote a procedure that that says
> > If touching? "orange1 "t2 [stop announce [.486 m/s]]
> >
> > This is not working. The turtle is not reacting to the command. Any
> > ideas? I also tried using if colorunder = brown [stop announce [.486
> > m/s]
>
> Hi,
>
> Here are some possible things to consider in addition to what Jeff has
> mentioned:
> *The process that runs the conditional "if" must be running while the
> turtle is moving so that the condition is constantly being tested. Use
> forever or a button set to forever to make sure the process is running as
> the turtle is moving.
> * To stop the turtle, you could use "clickoff" if the turtle is running an
> onclick instruction. Or you can use stopall in (or out of) the procedure.
> That stops everything.
> *Use the color number, not the color name with colorunder (eg, if
> colorunder
> = 35 [announce [This color is brown] stopall]
>
>
> Hope that helps,
>
> Susan
>
> LCSI
>
> _______________________________________________
> MWForum mailing list
> MWForum@lists.mathcats.com
> http://lists.mathcats.com/mailman/listinfo/mwforum
> Attachments archived at:
> http://www.mathcats.com/mwforum/attachments.html
> To unsubscribe or for administrative questions contact
> mailto:mwforum-admin@lists.mathcats.com
>