Hi I am a college student who is in a CGI Film production program at the University of New Mexico. The program (called IFDM) is sponsored by Sony studios and Sony Imageworks.
I know a great deal about modeling, texturing, and some animation, using software such as Maya, 3DS Max, and Houdini....however one of our new core classes is a computer programming class: "Intro to Python". Unfortunately I have zero knowledge of how to use Python or any coding or programming skills whatsoever. So far I have been able to figure some of this stuff out (turtle graphics mainly), but this coding for the "Lindenmayer System" has me really stuck. Here is my assignment as posted on our college website for this class.
Write a program that takes 3 inputs:
1) Draw String: This must be a string of draw commands (see the table below).
2) Length: This must be an integer equal greater than 0 and less than or equal to 100. It defines the length variable used in some of the draw commands.
3) Angle: This must be a floating point number equal greater than 0.0 and less than or equal to 360.0. It defines the angle variable used in some of the draw commands.
Character Draw Commands
Draw a straight line segment length pixels long in the current
f Same as h
Move, without drawing, a straight line segment length pixels
long in the current heading.
+ Turn the heading clockwise by angle.
- Turn the heading counter-clockwise by angle.
Each of these color commands must change the turtle color to
color that is different form the background and different from
the other 5 color commands. Pick colors that you think look good
There is also one other piece of info:
Now that you have the "if" statement at your command, you do need to check for bad input. If the user inputs bad data, print an error message and exit the program.
so, I guess my question is, how do I go about coding this stuff. I think what I am doing is turning these letters into commands such as turtle.forward((something), or turtle.turn(right, or left)... I have a textbook and have read the chapter, but it doesn't really address this assignment. I would really appreciate any help anyone could give me on how to get started with this assignment. I am sorry it is such a long post, I am just trying to be as precise as I can on what the assignment is asking for. Any help or guidance would be very much appreciated. Thank You:)
Last edited by micseydel
on Tue Sep 17, 2013 12:30 am, edited 1 time in total.
Reason: First post lock.