Oct-24-2016, 05:14 PM
The first step to solving your problem, is fixing your code so it will actually run. Line 35, for example, literally does nothing (parentheses are needed to call a function).
And please, just make two functions instead of nesting one inside of another. There are valid reasons to have functions within functions, but this is not one of them.
Likewise, there are valid reasons for a function to call itself, but this is not one of those times. A while loop is much better (for your mind to wrap around what's happening, in addition to the stack and memory management).
You also have "import random" at a random point, that should be the very first line of your file.
Once you've organized it a little better following these tips, your code will be much easier to add new things to. As it stands, it is like a descent into madness, the threads of your mind unraveling before us, in neat little lines leading into a dark abyss from which nothing escapes.
And please, just make two functions instead of nesting one inside of another. There are valid reasons to have functions within functions, but this is not one of them.
Likewise, there are valid reasons for a function to call itself, but this is not one of those times. A while loop is much better (for your mind to wrap around what's happening, in addition to the stack and memory management).
You also have "import random" at a random point, that should be the very first line of your file.
Once you've organized it a little better following these tips, your code will be much easier to add new things to. As it stands, it is like a descent into madness, the threads of your mind unraveling before us, in neat little lines leading into a dark abyss from which nothing escapes.