[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

LOGO-L> Reading Lists



Dear All,
I have watched all the messages flying and am amazed at the quick
responses and the number and variety of responses.  If possible I would
like some help.  I am currently learning about Lego and Logo and I am
having great fun but I have encountered a problem.

I have designed a boom gate and I am attempting to write a procedure
that would allow the driver to input a number that would automatically
raise the boom gate.  The boom gate operation is not a problem but I am
having trouble with interpreting the numbers.

Currently, I have created a list that consists of 1 for a pass and 0 for

a fail.  My procedure requires the processing of the number into its
list place.  I currently have:
to startup
make "datalist [0 1 1 0 1 0 1 0 1 etc]
end

to barcode :number
make "number item :number :datalist
ifelse :number = 1 [gate] [show [Sorry, wrong number]]
end

The concept is that the barcode procedure reads the placing of that
number in the datalist.  If that position has been attributed a 1 the
boom gate procedure will run.  If not a "Sorry" message will appear.

There must be an easier way of doing this.  I would like the procedure
to be able to determine if a number is an item of the list but I cannot
work out how to do this.

Any ideas!  I know I am a beginner!

Thanks
Kathy McAlister



---------------------------------------------------------------
Please post messages to the Logo forum to logo-l@gsn.org.  Mail
questions about the list administration to logofdn@gsn.org.  To
unsubscribe send    unsubscribe logo-l    to majordomo@gsn.org.



Global SchoolNet Foundation - Linking Kids Around the World!
Copyright GSN - All Rights Reserved - Comments & Questions
Visit GSN's Global Schoolhouse for more exciting learning resources!
Search our Site - Home