Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

LOGO-L> John Wood's problem with RUN

0 views
Skip to first unread message

John Hayes

unread,
Jul 6, 1999, 3:00:00 AM7/6/99
to LOGO forum
On 6/7/99 you wrote:
"The information that was sent was very helpful - especially the idea of
'word' to combine the parts BUT there is still a problem.

RUN :PLAY does not work.

I put in PRINT :PLAY and it prints POWER_RIGHT as expected, but when
it gets to RUN :PLAY it tells me that run requires a list as its first
input. When I put a [] around :PLAY then I get a message:
You don't say what to do with the output of PLAY"

Here's something to try:

First, Bill Glass reminds us that PLAY is a primitive, so use another name,
perhaps PLAY.IT.
Now you need to have a list for RUN, so the contents of PLAY.IT need to be
enclosed within brackets. To bring that about PLAY.IT must initially be an
empty list, so MAKE "PLAY.IT [].
Then put POWER, SLOT into the list with FPUT. _LEFT and _RIGHT are then
brought in by joining them to the contents of PLAY.IT with WORD and FIRST.
So,

to action
make "play.it []
if equal? :CH_FORM 1 [make "play.it fput "POWER :play.it] else [make
"play.it fput "SLOT :play.it]
if equal? :CH_SIDE "L [make "play.it word first:play.it "_LEFT] else [make
"play.it word first :play.it "_RIGHT]
run :play.it
end

John Hayes
---------------------------------------------------------------
Please post messages to the Logo forum to log...@gsn.org. Mail
questions about the list administration to log...@gsn.org. To
unsubscribe send unsubscribe logo-l to majo...@gsn.org.

0 new messages