Feb-16-2019, 07:39 PM
Is there some reason this has to be done recursively? It does not strike me as a program well suited for recursion, certainly not in Python. It would be far to easy to hit the recursion limit.
I would just have a function that checks for increasing digits. Then a simple loop where you increase n by one, check that for increasing digits, and then break and return if you have them. The same code with a function for decreasing digits solves the other side of the problem.
I would just have a function that checks for increasing digits. Then a simple loop where you increase n by one, check that for increasing digits, and then break and return if you have them. The same code with a function for decreasing digits solves the other side of the problem.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures