Home
Project Folders
Teacher Resources
Student Resources
How Do I?
Literacy
MWForum
Site Map
Search
Our Team

MWForum Message [Date Index] [Threads] [Authors] [Attachments] [Subscribe]

[Thread Prev] [Thread Next]

To: <mwforum@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Subject: RE: Heading issue
From: "Boyd, Ronald" <Ronald.Boyd@xxxxxxxxxxxxxxx>
Date: Mon, 30 Jul 2007 21:12:34 -0500

Still troubles with the first procedure for non-polygon. But then a solution.
Next attempt: 

to non-polygon 

jag,

ifelse and (heading > 284) (heading < 85)[correct][wrong]

end

::The earlier fix works for the polygon button but not for the one above. It
seems that the problem is that the two statements are in opposition of each
other. If I remove the second part of the procedure it will work up to heading
0, If I remove the second part it will work from heading 0-84. 

to non-polygon 

jag,

ifelse and (heading > 284)[correct][wrong]

end

I tried separating the procedures with mixed results it would give me two
messages for this. Which makes sense.

to non-polygon 

jag,

ifelse (heading > 284)[correct][wrong]

ifelse (heading < 85)[correct][wrong]

end

I found out that in this case you would need to use an or condition in the
statement for it to work like this.
 

to non-polygon 

jag,

ifelse or (heading > 284) (heading < 85)[correct][wrong]

end

So is there an answer to this possibility? What if the student had drawn the
shapes around the circle in a more random manner so that having a heading of
285-84 was not correct for one of the two choices but was instead correct for
heading 285-360, 34-76, 150-190. Would you have to write the code for the
button with and Or condition?
 
Ronald Boyd
GT Coordinator/Technology Integration Specialist
Rosemount Elementary
651-423-7690
ronald.boyd@xxxxxxxxxxxxxxx

________________________________

From: mwforum-admin@xxxxxxxxxxxxxxxxxxxxxxxxxxxx on behalf of Daniel Ajoy
Sent: Sun 7/29/2007 9:44 PM
To: mwforum@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Subject: Re: Heading issue



On 29 Jul 2007 at 14:45, Boyd, Ronald wrote:

> This is a project from one of my students from this past
> week. His page polygon-or-non was a bit of a stretch for
> the intention of the project and so went unfinished at the
> end of the week show. Our problem was in trying to write a
> procedure that would sense the heading of the turtle
> respond correclty to the users choice of polygon or non
> polygon. Luckily he choose to draw the non-polygon shapes
> next to each other which should have made it easier. Our
> first attempt is in the turtles note section. We tried
> having two buttons that would elicit either a correct or a
> incorrect response based on sensing if the turtles heading
> fell within a parameter using the ifelse.

the code was:

to non-polygon 
jag,
ifelse {heading > 284 and heading < 85} [correct][wrong]
end

to polygonshape
jag,
ifelse {heading < 285 and heading > 85} [correct][wrong]
end

to correct
announce [correct]
end

to wrong
announce [Try again]
end


but "and" is like any other procedure in MicroWorlds
it receives two inputs, that should be truth values.

The right syntax is:

ifelse and (heading > 284) (heading < 85) [correct][wrong]

or simply

ifelse and heading > 284 heading < 85 [correct][wrong]



I've never seen curly brackets used in MicroWorlds:


Daniel
OpenWorld Learning



<<winmail.dat>>


  • Previous by thread: RE: Heading issue
  • Next by thread: RE: Heading issue

  • To save an attachment to your computer, PC users should right-click (Mac users, click and hold the mouse button) on the link and then choose 'save target as' from the pop-up menu. A window will then pop up in which you can choose a location for the file.


    © copyright 2001 - 2008