|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| MWForum Message | [Date Index] [Threads] [Authors] [Attachments] [Subscribe] | ||||||||
Hi Graham, I think you are right, better to put the list of points in a procedure, maybe in Startup. Something like:... make "pts [[x1 y1][x2 y2]...[xn yn]] ... This way the values are there from the get-go. Then they may be accessed with:... setpos item :cnt :pts ... where "cnt is a counter that is incremented with each call to the procedure:... make "cnt :cnt + 1 .... Or something similar for a random choice. Notice that:... make "cnt 1 ... must be done in a prior procedure - again, maybe in Startup. Then, when :cnt is equal to the number of points in the list, there is a:... make "cnt 1 ... again, so the process starts over. --Jeff ----- Original Message ----- From: <GrahamWilliams@xxxxxxxxxxxxxxxxxxxxxx> To: <mwforum@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> Sent: Wednesday, November 23, 2005 12:46 PM Subject: Send turtle to different positions???
I have a student [working in Mworld Pro on Win XP ] who is trying to set-up a project wherein at the click of a button the turtle goes to the first x-y position given in a list of coordinates which are to be stored in a textbox which will be hidden on the project page [ altho he could just include them in the body of a procedure ]. Then , when the button is clicked again the turtle will go to the second of the positions listed in the text box . At another click of the button the turtle would go to the third listed position and so on.... I assume he has to get Microworlds to read, in sequence, the coordinates listed in the hidden text-box and send this information to the turtle but I'm not sure how to go about it ! Also, the student thought he might go a step further and have the turtle go to positions selected at random from the same list of co-ordinates listed in the hidden text-box. <<TURTLE_TO_DIFFERENT_POSITIONS.mw2>> I'd very much appreciate it if anyone could help me with this. Also, does anyone know the title[s] of any publication[s] currently in print and readily available which teach/explain the conventions/syntax of programming in MWLogo - from basic to more complex? I'd love to have such a publication at my finger-tips to be able to give immediate assistance to my students . Many thanks . Graham Williams To save an attachment to your computer, PC users should right-click (Mac users, click and hold the mouse button) on the link and then choose 'save target as' from the pop-up menu. A window will then pop up in which you can choose a location for the file. | |||||||||