To start off with, for those of you not familiar with L-systems, here's the the Wikipedia [link]. Now that the uninformed are off informing themselves, on to business. I am trying to create a good L-system evaluator, and in the process create a turtle graphics program. (again, if unfamiliar, click [link]) I pretty much have the math down for the turtle, I just need help with the command-string reader. there's very little organization, but basically, you ask for the axiom, the rule(s), the angel( more on that later), and the iteration and it'll draw it for you. Here's the elements that it can interact with:
  • F: this means 'draw forward'
  • H: this is the same as F, it's only there for more variability in the rulestrings.
  • C: toggles penUp on the turtle.
  • G: moves with penUp. CFC or CHC would work too, but this takes up less room.
  • - and +: these change the direction the turtle is facing by the angle I mentioned previously.
  • [: this pushes the current state of the turtle to a LIFO stack. (LIFO means Last-In-First-Out. sorry, URL BBCode doesn't work within List BBcode.)
  • ]: This pops the last element on the stack to the turtle.
Basic trig functions can be applied to move the turtle, the X-movement is sin(θ)/(distance), whereas the Y-movement uses cos( instead of sin(. Until I must do otherwise, I'm using θ as the current direction of the turtle. Any help with this would be greatly appreciated, especially with generating the stack in vanilla BASIC. (yes, I love DCS7 and other help-apps, but not everyone has it.)
Doors CS 7 is sufficiently wide-spread now, and it's sufficiently trivial for people to get that I don't see a point in deliberately avoiding it. As you implied, Doors CS 7's DCSB Libs include a feature called the Ans Stack that sounds like exactly what you need. I strongly recommend you explore whether that will give you the features you need.

JLovern wrote:
sorry, URL BBCode doesn't work within List BBcode
It actually works fine - I suspect your URL may have had special characters.
well, then the preview didn't work. all my links were to a Wikipedia page.
Yeah, I try not to go into the murky middle-grounds of having only a few library token entries in each program. either I go overboard and optimize it for {insert library here}, or I keep it vanilla. The Ans Stack may indeed be what I need, and it'll give me much needed practice with it.
JLovern wrote:
Yeah, I try not to go into the murky middle-grounds of having only a few library token entries in each program. either I go overboard and optimize it for {insert library here}, or I keep it vanilla. The Ans Stack may indeed be what I need, and it'll give me much needed practice with it.
Great; I hope you'll do so! Please post your experiences here if you have any comments or questions, and I'll be happy to help. By the way, for future reference, please try to avoid double-posting. Smile
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement