[MWForum] CASE conditional?
Daniel Ajoy
mwforum@lists.mathcats.com
Tue, 02 Mar 2004 11:46:33 -0500
Hi Bob,
In Logo you can program structures:
TO TRYME
QUESTION [ENTER A SINGLE DIGIT NUMBER OR YOUR NAME]
CASE ANSWER [
[1 2 3] [show (se 1 2 "or 3 "entered.)]
[4 5 6] [show (se 4 5 "or 6 "entered.)]
else [show [default case selected]]
]
END
TO CASE :VALUE :CASES
IF EMPTY? :CASES [STOP]
IF OR EQUAL? "ELSE FIRST :CASES MEMBER? :VALUE FIRST :CASES [RUN FIRST BUTFIRST :CASES STOP]
CASE :VALUE BUTFIRST BUTFIRST :CASES
END
Daniel
OpenWorld Learning
On 2 Mar 2004 at 11:01, Bob Irving wrote:
> Hi all,
>
> I'm a newbie MW instructor, using it in grade 6, where I am having my
> students write a game for the grade 5 math classes. What I'm wondering is
> if there is some sort of CASE structure, which would allow several options
> to an answer: kind of yes/no/maybe/not sure. Then have branching logic for
> each one.
>
> Or do I just have to use 4 if statements?
>
> TIA,
> Bob Irving
> Middle School Technology Coordinator
> Lancaster Country Day School
> Lancaster, PA 17603
> Weblog: http://bobirving.weblogs.us/
>