'''
Copyright (C) 2005 Aaron Spike, aaron@ekips.org
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
def stripme(s):
return s.strip()
help="number of iteration")
help="angle for turning left")
help="angle for turning right")
help="step size")
help="randomize step")
help="randomize angle")
help="initial state of system")
help="replacement rules")
dest="tab")
self.rules = dict([map(stripme, i.split("=")) for i in self.options.rules.upper().split(";") if i.count("=")==1])
for c in string:
if c in 'ABCDEF':
elif c in 'GHIJKL':
elif c == '+':
self.turtle.lt(self.options.langle * (random.normalvariate(1.0, 0.01 * self.options.randomizeangle)))
elif c == '-':
self.turtle.rt(self.options.rangle * (random.normalvariate(1.0, 0.01 * self.options.randomizeangle)))
elif c == '|':
elif c == '[':
elif c == ']':
level_string = ''
for c in rule:
try:
except KeyError:
level_string = level_string + c
else:
level_string = level_string + c
return level_string
'stroke-opacity': '1.0', 'fill-opacity': '1.0',
'stroke': '#000000', 'stroke-linecap': 'butt',
'fill': 'none'}
if __name__ == '__main__':
e = LSystem()
e.affect()
# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 fileencoding=utf-8 textwidth=99