Jump to content




gom - Improvement of the builtin go program


  • You cannot reply to this topic
No replies to this topic

#1 Self-aware turtle

  • New Members
  • 2 posts

Posted 30 August 2014 - 07: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.:
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 by Self-aware turtle, 30 August 2014 - 09:13 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users