[MWForum]Re: Microworlds Pro Key Commands

Ralph Wege mwforum@lists.mathcats.com
Sat, 04 Jan 2003 23:09:58 -0800


I greatly appreciate your reply, Daniel Aljoy, to my request regarding turtle
control with single keys. Sorry about the delay in replying. My students will
be overjoyed that we have solved this and they can now proceed with their
projects. Again, thank you. I will now send another message that has a set of
procedures that gives a three dimensional wire frame prism in which you
control the number of sides, the length of each side and the length of the
prism.

Ralph Wege

mwforum-request@lists.mathcats.com wrote:

> Send MWForum mailing list submissions to
>         mwforum@lists.mathcats.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://lists.mathcats.com/mailman/listinfo/mwforum
> or, via email, send a message with subject or body 'help' to
>         mwforum-request@lists.mathcats.com
>
> You can reach the person managing the list at
>         mwforum-admin@lists.mathcats.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of MWForum digest..."
>
> Today's Topics:
>
>    1. Microworlds Pro Key Commands (Ralph Wege)
>    2. Re: Microworlds Pro Key Commands (Daniel Ajoy)
>
> --__--__--
>
> Message: 1
> Date: Sat, 21 Dec 2002 08:20:36 -0800
> From: Ralph Wege <rwege@monterey.k12.ca.us>
> Organization: wusd
> To: mwforum@lists.mathcats.com
> Subject: [MWForum]Microworlds Pro Key Commands
> Reply-To: mwforum@lists.mathcats.com
>
> What are the commands to make the turtle respond to keystrokes? In
> particular, I want to use the arrow keys to control the turtle's
> movements in direction aned speed, kind of like it is a spacecraft with
> thrusters. I know that you use ASCII codes but I don't know the commands
> to activate the keys. Please help.
>
> Ralph
>
> --__--__--
>
> Message: 2
> From: "Daniel Ajoy" <dajoy@openworldlearning.org>
> To: mwforum@lists.mathcats.com
> Date: Sat, 21 Dec 2002 12:40:06 -0500
> Subject: Re: [MWForum]Microworlds Pro Key Commands
> Reply-To: mwforum@lists.mathcats.com
>
> On 21 Dec 2002 at 8:20, Ralph Wege wrote:
>
> > What are the commands to make the turtle respond to keystrokes? In
> > particular, I want to use the arrow keys to control the turtle's
> > movements in direction aned speed, kind of like it is a spacecraft with
> > thrusters. I know that you use ASCII codes but I don't know the commands
> > to activate the keys. Please help.
> >
> > Ralph
> >
>
> The following is what Wendy wrote to the LogoForum last year,
> Michael Tempel talks about this same thing here:
>
> http://el.media.mit.edu/logo-foundation/pubs/logoupdate/v7n3/games2.html
>
> Daniel
> OpenWorld Learning
>
> >From Wendy Petti <wpetti@mathcats.com> Thu Nov 29 10:36:39 2001
> To: LogoForum@yahoogroups.com
> Subject: Re: Web help
>
> In terms of programming arrow keys in MicroWorlds, it is simple
> enough to combine both the PC and the Mac ascii codes into one
> procedure. I learned this from Michael Tempel when we were both
> visiting OpenWorld Learning in Colorado last June. But he used
> different ascii numbers for the arrow keys on the PC than Jeff has
> given. Here is what Michael uses. (He adds a "go" button and
> procedure to set the turtle in motion and activate the key
> programming. The turtle's command is FD 1, set to many times. With
> today's faster computers, it might be better to give the turtle the
> command FD 1 / 10 or another fraction, or if you have a slider named
> speed then the turtle's command could be FD SPEED / 10 and you'd
> have to figure out an appropriate maximum for the speed slider). The
> first four ascii codes are for PC (different from Jeff's numbers);
> the second four are the Mac codes which Jeff also uses:
>
> to go
> t1,
> clickon
> forever [direct readchar]
> end
>
> to direct :key
> if (ascii :key) = 37 [ seth 270]
> if (ascii :key) = 39 [ seth 90]
> if (ascii :key) = 38 [ seth 0]
> if (ascii :key) = 40 [ seth 180]
> if (ascii :key) = 28 [ seth 270]
> if (ascii :key) = 29 [ seth 90]
> if (ascii :key) = 30 [ seth 0]
> if (ascii :key) = 31 [ seth 180]
> if :key = "s [stopall]
> end
>
> Of course, another solution would be to use four letter keys instead
> of using arrow keys. That way, the same four commands work for PC or
> Mac.
>
> In fact, if you program two sets of letter keys, you can have four
> keys control one turtle and four control another turtle so that two
> students can compete with each other to see which turtle can get
> through the maze more quickly (or accomplish some other goal). You
> can use keys A, S, D, and W to control one turtle and keys J, K, L,
> and I to control the other one. (Of course, in that case you could
> not use the S key to stop the procedure. You could include
> a "stopall" button or program a different key.) You need to designate
> which turtle will respond to each key. So a two-turtle control
> procedure might look like this:
>
> to direct :key
> if :key = "a [t1, seth 270]
> if :key = "s [t1, seth 180]
> if :key = "d [t1, seth 90]
> if :key = "w [t1, seth 0]
> if :key = "j [t2, seth 270]
> if :key = "k [t2, seth 180]
> if :key = "l [t2, seth 90]
> if :key = "i [t2, seth 0]
> end
>
> (If you really want to form a crowd around one computer, you could
> program the arrow keys too, for a third student to control a third
> turtle!)
>
> Wendy Petti
> MicroWorlds in Action
> http://www.openworldlearning.org/owlb/projects.htm
>
> --__--__--
>
> _______________________________________________
> MWForum mailing list
> MWForum@lists.mathcats.com
> http://lists.mathcats.com/mailman/listinfo/mwforum
>
> End of MWForum Digest