in reply to Re: Re: Guess A Number
in thread Guess A Number

Hi sulfericacid
If you use appropriate code-editor it will indent for you automatically as you type. I use emacs, and it works very well. Besides indenting there are lots of other features in emacs, like auto-typing , hiding certain code while developing, auto-ftp etc..

example for indentation from your code:

while ($tries < $allowed) { print " Your guess: "; chomp($guess = <STDIN>); $tries++; if ($guess eq $answer) { last; } elsif ($guess > $answer) { print " $guess is too high!\n"; } elsif ($guess < $answer) { print " $guess is too low!\n"; } }

If you like to use emacs visit:http://www.gnu.org/software/emacs/. It's worth investment of time.

One more point, make your code little modular. That would increase the readability also.

artist

Replies are listed 'Best First'.
Re: Re: Re: Re: Guess A Number
by sulfericacid (Deacon) on Mar 18, 2003 at 04:27 UTC
    I downloaded Emacs a few days past as someone in the CB said that it would automatically align the codes for you as well. After downloading it and searching through the help docs and asking in the CB no one was able to tell me how to get my code aligned. I ended up going with PerlTidy because that made my code all nice and pretty looking, lol.

    Thanks for the example indentation and the suggestion for Emacs.

    "Age is nothing more than an inaccurate number bestowed upon us at birth as just another means for others to judge and classify us"

    sulfericacid