Home
Project Folders
Teacher Resources
Student Resources
How Do I?
Literacy
MWForum
Site Map
Search
Our Team

MWForum Message [Date Index] [Threads] [Authors] [Attachments] [Subscribe]

[Thread Prev] [Thread Next]

To: "MicroWorlds Forum" <mwforum@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: robot and maze
From: "Daniel Ajoy" <da.ajoy@xxxxxxxxx>
Date: Fri, 31 Dec 2010 10:13:04 -0500

On Fri, 31 Dec 2010 02:38:46 -0500, Rotem Kimchi <rotemk2@xxxxxxxxxxxxxxxx> wrote:

good morning,

are those functions
create.maze
 startup.position
are only names that you choose that include point between or is the point is
like a pathway to other files/projects?

I chose the point as part of the name of the functions.

about your code you are not following the wall of the maze right? you simply
moving one step forward rotate to the right checking for wall and if there
is a wall you will move forward if not you will rotate left and while there
is no wall you will move forward.

I do follow the wall.

Let's say the robot has in a long hall ahead, there is a wall to the right. the robot:

turns right, and detects the wall, so it turns left
moves forward along the corridor.
turns right, and detects the wall, so it turns left
moves forward along the corridor.
turns right, and detects the wall, so it turns left
moves forward along the corridor.
...

If there is no wall to the right, then it will follow that opportunity.

there isn't a while command in microworld pro but i assume its like while
command in c that repeat itself until true?

it repeats itself ***while*** true.

Here is a "while" procedure in Microworlds for you. Logo is so flexible hat you can program your own loop structures.


to while :cond :instruction.list
if run :cond [run :instruction.list]
while :cond :instruction.list
end


make "a 1
while [:a < 10] [show :a   make "a :a + 1]

1
2
3
4
5
6
7
8
9



  • Previous by thread: Re: robot and maze
  • Next by thread: CarWars

  • 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.


    © copyright 2001 - 2008