[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

LOGO-L> Non-alterable file



Hello,

I have this .txt file in which there is a LOGO program with not all
procedures defined yet. The thing I have to do now is to define these
procedures so that when someone loads the .txt file with my program, one
can see the output of it all. No alterations may be made on the .txt file,
though! Trouble is this doesn't work (yet)!
In the .txt file, there is a line which says: 
while not westward turn_right
When I have made the procedures westward and turn_right, the turtle must turn
so that it is oriented to the west at the end. I have tried doing this by
defining a variable "direction which is initialised at 0 since the turtle
is always oriented to the north in the beginning. Other values for
:direction are 1 (east), 2 (south) and 3 (west).
My procedures are as follows:
to turn_right
  rt 90
  make "direction :direction + 1
  test 3 < :direction
  iftrue make "direction :direction - 4
end
to westward
  ifelse :direction = 3 [ op "true] [ op "false]
end
I keep getting this error message that "turn_right didn't output to while".
Why doesn't this work and what can I change about it?

Leen

---------------------------------------------------------------
Please post messages to the Logo forum to logo-l@gsn.org.  Mail
questions about the list administration to logofdn@gsn.org.  To
unsubscribe send    unsubscribe logo-l    to majordomo@gsn.org.



Global SchoolNet Foundation - Linking Kids Around the World!
Copyright GSN - All Rights Reserved - Comments & Questions
Visit GSN's Global Schoolhouse for more exciting learning resources!
Search our Site - Home