[Tutor] Functions Calling Functions

Bill Mill bill.mill at gmail.com
Fri Feb 25 20:10:22 CET 2005


Luke,


On Fri, 25 Feb 2005 11:04:11 -0800, Luke Jordan <luke.jordan at gmail.com> wrote:
> Hi -
> 
> I'm working on a command-line game. Is there anything wrong with
> having each 'chapter' of the game be a function that links to other
> chapters by calling them? I only ask because when a recent traceback
> returned about 40 lines worth of error message, I realized that the
> functions are all being run 'within each other' (ah-ha!).
> 

for your own debugging sanity, you'll likely want to have a supervisor
function which calls the chapter functions in order. There's nothing
technically wrong with what you're doing, as long as you don't exceed
the maximum recursion depth, but it's a pain to debug and takes up a
whole bunch of memory you don't need.

Peace
Bill Mill
bill.mill at gmail.com


More information about the Tutor mailing list