[Tutor] help on scope

Glen Wheeler wheelege@tsn.cc
Tue, 24 Jul 2001 19:57:27 +1000


From: "Charlie Clark" <charlie@begeistert.org
>
> I'm writing a little program that makes anagrams. Something I failed to do
> miserably in basic when I first dabbled in programming 20 years ago. I'm
> using count to help me check whether the algorithm is working properly. As
I
> use a recursive function I need to initialise my counter outside the
function
> but increment with each new word. Passing the counter as an argument
removes
> problems of scope but feels wrong. I agree, however, that it is better
than
> using global. Am I missing something?
>

  What what what, recursion for anagrams?  I have been a little lax on the
tutor list (go the integer division debate...well, it did go) but I'm pretty
sure you don't need to do recursion for something like an anagram program.
  Unless of course you are trying to learn recursion - at which point I'll
be quiet :)

  Carry on,
  Glen.