Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Unoptimized, and actually wrong code
- # Written to solve problems in my textbook, and does that well
- # Don't use, don't judge.
- def solve(functions):
- def solve_recurse(functions, values, count):
- old_values = values[:]
- for i in range(len(functions)):
- values[i] = f(*values)
- print values
- if values == old_values:
- print "Solved in %s iterations!" % count
- else:
- solve_recurse(functions, values, count+1)
- solve_recurse(functions, [0 for f in functions], 1)
Add Comment
Please, Sign In to add comment