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

Re: LOGO-L> Reading Lists



Kathy it is not entirely clear what you want to do as your procedure works
as it currently is.

If you are thinking of using numbers other than '1' & '0' you could check
to see whether a particular item is a member of a 'numberlist' i.e.

make "numberlist [4 7 9]

tested by 

ifelse memberp :number :numberlist [gate][show [Sorry, wrong number]

Does that help?


At 10:12 AM 7/27/98 +1000, Kathy McAlister wrote:
>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.
>
Paul Dench
---------------------------------------------------------------
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