Le Mercredi 31 Mai 2006 08:58, Bo Yang a écrit : > RuntimeError: maximum recursion depth exceeded It's tied to the recursive call to the ring function, python raises a limit to recursive calls to avoid infinite recursion. You can just adjust the limit using these two lines when you call the function ring : import sys sys.setrecursionlimit(10000) # or whatever, the default is 1000 and set back the limit to its default after the call.
Note that function calls are memory expensive and the recursive implementation of an algorithm must be considered (in particular in python) as an "elegant but not optimized" one. -- _____________ Maric Michaud _____________ Aristote - www.aristote.info 3 place des tapis 69004 Lyon Tel: +33 426 880 097 -- http://mail.python.org/mailman/listinfo/python-list