Re: An algorithm problem

2006-05-31 Thread John Machin
On 31/05/2006 7:20 PM, Bo Yang wrote: > I am sorry , and thanks for your friendliness . > I have change my source code for more meaningful variable name and more > comments follow the instructions > John has writen . I think that is useful for you to look my code . > > And this time I put the cod

Re: An algorithm problem

2006-05-31 Thread Maric Michaud
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 functi

Re: An algorithm problem

2006-05-31 Thread Bo Yang
I am sorry , and thanks for your friendliness . I have change my source code for more meaningful variable name and more comments follow the instructions John has writen . I think that is useful for you to look my code . And this time I put the code in the attachment . Indeed , I write that in

Re: An algorithm problem

2006-05-31 Thread Bo Yang
I am sorry , and thanks for your friendliness . I have change my source code for more meaningful variable name and more comments follow the instructions John has writen . I think that is useful for you to look my code . And this time I put the code in the attachment . Indeed , I write that in th

Re: An algorithm problem

2006-05-31 Thread John Machin
On 31/05/2006 4:58 PM, Bo Yang wrote: > Hi , > I have writen a python program to slove a problem described as below: > > (Forgive my poor English !) > > Put the 2^n 0 or 1 to form a ring , Sorry, I can't understand that. It would be very helpful if you wrote out (for example, when n == 3) what t

Re: An algorithm problem

2006-05-31 Thread Sybren Stuvel
Bo Yang enlightened us with: > I have writen a python program to slove a problem described as > below: Please post again, but then leaving indentation intact, since this is unreadable. Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidit

An algorithm problem

2006-05-30 Thread Bo Yang
Hi , I have writen a python program to slove a problem described as below: (Forgive my poor English !) Put the 2^n 0 or 1 to form a ring , and we can select any continuous n ones from the ring to constitute a binary number . And obviously we can get 2^n selections , so the question is : Given a n