Python Forum
Increasing depth in python
Thread Rating:
  • 2 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Increasing depth in python
#20
Okay, so this is my last try.

Im almost done, i just need to make this "start" int function properly.

I made it this far:
def step(rules, state):
   result=[]
   for x in state:
      if x==rules:
         result.append(state)
      else:
         result.append(x)

   flatten = [inner for outer in result for inner in outer]
   print(flatten)

#this function description is to write a function compute(depth,rules,start) that uses the step function depth times to transform the list start into a list representing a fractal of depth depth.
   def compute(depth, rules, start):
      for i in range(depth):
         step("F",["F","L","F","R","F","L","F"])

compute(1,"F",["F","R"])
the list "start" is not in use right now, and i just need some hints to what i can do.
I think i came a lot longer on my own, so can you plz help me a bit here?

I've written what the function is supposed to do in the #symbol above the def compute() function.

best regards Malling
Reply


Messages In This Thread
Fractals in python using fdl - by malling - Oct-20-2016, 11:06 AM
RE: Increasing depth in python - by malling - Oct-20-2016, 06:44 PM
RE: Increasing depth in python - by nilamo - Oct-20-2016, 06:48 PM
RE: Increasing depth in python - by malling - Oct-20-2016, 07:30 PM
RE: Increasing depth in python - by nilamo - Oct-20-2016, 07:48 PM
RE: Increasing depth in python - by malling - Oct-20-2016, 07:51 PM
RE: Increasing depth in python - by sparkz_alot - Oct-20-2016, 08:01 PM
RE: Increasing depth in python - by nilamo - Oct-20-2016, 08:01 PM
RE: Increasing depth in python - by malling - Oct-20-2016, 08:08 PM
RE: Increasing depth in python - by nilamo - Oct-20-2016, 08:48 PM
RE: Increasing depth in python - by malling - Oct-20-2016, 08:53 PM
RE: Increasing depth in python - by nilamo - Oct-20-2016, 09:50 PM
RE: Increasing depth in python - by malling - Oct-20-2016, 10:43 PM
RE: Fractals in python using fdl - by Yoriz - Oct-20-2016, 12:27 PM
RE: Fractals in python using fdl - by malling - Oct-20-2016, 04:10 PM
Increasing depth in python - by malling - Oct-20-2016, 04:21 PM
RE: Increasing depth in python - by nilamo - Oct-20-2016, 04:45 PM
RE: Increasing depth in python - by malling - Oct-20-2016, 05:24 PM
RE: Increasing depth in python - by nilamo - Oct-20-2016, 05:38 PM
RE: Fractals in python using fdl - by metulburr - Oct-20-2016, 05:37 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  "RecursionError: maximum recursion depth exceeded in comparison" hhydration 1 1,831 Sep-26-2020, 03:07 PM
Last Post: deanhystad
  Digits increasing meknowsnothing 6 4,119 Feb-17-2019, 11:22 AM
Last Post: scidam
  Increasing difficulty of a maths game Maxxy_Gray 1 3,201 Apr-04-2018, 03:00 PM
Last Post: sparkz_alot

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020