>From: owner-log...@gsn.org (logo-l-digest)
>Reply-To: log...@gsn.org
>To: logo-l...@gsn.org
>Subject: logo-l-digest V6 #4
>Date: Mon, 5 Jul 1999 01:02:05 -0700
>
>logo-l-digest Monday, July 5 1999 Volume 06 : Number
>004
>
>
>
>+++++++++++++++++++++++++++++++++++++++
>Subjects Included in this Digest Volume
>+++++++++++++++++++++++++++++++++++++++
>Re: LOGO-L> using variables to create a procedure name
>LOGO-L> J L Wood's problem: Using variables to create a procedure name
>+++++++++++++++++++++++++++++++++++++++
>
>----------------------------------------------------------------------
>
>Date: Mon, 05 Jul 1999 08:15:16 +0800
>From: Paul C Dench <Paul....@bigpond.com>
>Subject: Re: LOGO-L> using variables to create a procedure name
>
>Hello
>
>This doesn't sound like Australian Rules Football or Soccer so I may have
>misunderstood but here goes:
>
>=============
>to action
>ifelse equalp :CH_FORM 1 [make "PLAY "POWER_][make "PLAY "SLOT_]
>ifelse equalp :CH_SIDE "L~
> [make "PLAY word :PLAY "LEFT][make "PLAY word :PLAY "RIGHT]
>run :PLAY
>end
>==============
>
>the procedure action will convert your two decisions into one of four words
>- - POWER_RIGHT, POWER_LEFT, SLOT_RIGHT or SLOT_LEFT and then 'run :PLAY'
>will call the procedures you have already written.
>
>Regards
>
>
>At 10:43 PM 7/2/99 -0700, jlwo...@my-deja.com wrote:
> >
> >This may be a simple idea, but I would appreciate some guidance.
> >
> >This happens to be creating football formations for drawing of plays.
> >
> >I am making a play formation by combining a formation set-up and the side
>of
> >the strength.
> >
> >I am asking the operator to select a formation such as
> >
> >1 - power
> >2 - slot
> >
> >and then MAKE "CH_FORM READCHAR
> >
> >and
> >
> >L - left
> >R - right
> >
> >and then MAKE "CH_SIDE READCHAR
> >
> >I now want to form the actual formation: such as 1 & L will now create
>the
> >name of the procedure POWER_LEFT and 2 & R will create SLOT_RIGHT.
> >
> >I already have the procedures POWER_LEFT and SLOT_RIGHT. My question is
>how
> >to let the operator create the procedure name from their choices.
> >
> >I would hope to be able to use string addition ( a BASIC term) instead of
>a
> >multitude of IF AND statements. Also how does this become a procedure
>name
> >instead of a variable?
> >
> >Any help is greatly appreciated. THANK YOU !
>
>Paul C Dench
>
>Logo for Teachers and Parents
><http://www.cowan.edu.au/pa/ecawa/sig/logo/paul_dench/turtle/>
>- ---------------------------------------------------------------
>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.
>
>------------------------------
>
>Date: Mon, 5 Jul 1999 14:10:05 +1200
>From: "John Hayes" <jah...@xtra.co.nz>
>Subject: LOGO-L> J L Wood's problem: Using variables to create a procedure
>name
>
>1. J L Wood's problem is:
>
>This happens to be creating football formations for drawing of plays.
>
>I am making a play formation by combining a formation set-up and the side
>of
>the strength.
>
>I am asking the operator to select a formation such as
>
>1 - power
>2 - slot
>
>and then MAKE "CH_FORM READCHAR
>
>and
>
>L - left
>R - right
>
>and then MAKE "CH_SIDE READCHAR
>
>I now want to form the actual formation: such as 1 & L will now create
>the
>name of the procedure POWER_LEFT and 2 & R will create SLOT_RIGHT.
>
>I already have the procedures POWER_LEFT and SLOT_RIGHT. My question is
>how
>to let the operator create the procedure name from their choices.
>
>I would hope to be able to use string addition ( a BASIC term) instead of a
>multitude of IF AND statements. Also how does this become a procedure name
>instead of a variable?
>
>2. Paul Dench has provided an elegant solution:
>to action
>ifelse equalp :CH_FORM 1 [make "PLAY "POWER_][make "PLAY "SLOT_]
>ifelse equalp :CH_SIDE "L~
> [make "PLAY word :PLAY "LEFT][make "PLAY word :PLAY "RIGHT]
>run :PLAY
>end
>
>3. Here is Paul's solution restated in PC Logo 2 syntax, which requires
>ifelse to be IF statement THEN instructionlist ELSE instructionlist, and
>equalp to be equal?:
>to action
>if equal? :CH_FORM 1 [make "PLAY "POWER_] else [make "PLAY "SLOT_]
>if equal? :CH_SIDE "L [make "PLAY word :PLAY "_LEFT] else [make "PLAY word
>:PLAY "_RIGHT]
>run :PLAY
>end
>
>John Hayes
>Te Puke
>New Zealand
>
>- ---------------------------------------------------------------
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
I typed in POWER_RIGHT and the formation showed on the graphics screen.
Thank you for any additional help, it is greatly appreciated.
_______________________________________________________________
Get Free Email and Do More On The Web. Visit http://www.msn.com
---------------------------------------------------------------
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.
Bill
****************************************************************
Harvard Associates & makers of PC Logo and LogoPLUS
Terrapin Software Internet: in...@terrapinlogo.com
10 Holworthy Street phone: (617) 492-0660
Cambridge, MA 02138 USA fax: (617) 492-4610
World Wide Web: www.terrapinlogo.com
****************************************************************
-----Original Message-----
From: john wood <jlwo...@hotmail.com>
To: log...@gsn.org <log...@gsn.org>
Cc: jlwo...@my-deja.com <jlwo...@my-deja.com>
Date: Monday, July 05, 1999 10:40 AM
Subject: LOGO-L> Re: logo-l-digest V6 #4
>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
>
>I typed in POWER_RIGHT and the formation showed on the graphics screen.
>
>Thank you for any additional help, it is greatly appreciated.
>
>
>_______________________________________________________________
>Get Free Email and Do More On The Web. Visit http://www.msn.com
>---------------------------------------------------------------
>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.
>