Posted 30 August 2014 - 08:57 PM
Hi,
here is a simple program that comes in handy when you have to reposition your turtles.
Instead of running a combination of the builtin go and turn programs, gom (as with vi and vim) expects a list of movement commands.
E.g.:
If any obstacle is hit, execution skips to the next movement command. I believe this is pragmatic because often you will fail to estimate the exact distances. That way you can overestimate the distance and still get the result you want which makes the overall repositioning faster most of the times.
Feel free to improve.
http://pastebin.com/WAu0G2Jt
here is a simple program that comes in handy when you have to reposition your turtles.
Instead of running a combination of the builtin go and turn programs, gom (as with vi and vim) expects a list of movement commands.
E.g.:
gom 10f 3u 2tr b
This will send your turtle 10 steps forward, 3 up, turns it 2 times to the left, and finally sends it back 1 step (if no number is present, it defaults to 1). (Check the header file comment for a full list of available movements.)If any obstacle is hit, execution skips to the next movement command. I believe this is pragmatic because often you will fail to estimate the exact distances. That way you can overestimate the distance and still get the result you want which makes the overall repositioning faster most of the times.
Feel free to improve.
http://pastebin.com/WAu0G2Jt
Edited on 30 August 2014 - 08:13 PM