in reply to Wizard v1.0

I am not sure if you had issues when you cut and pasted the code, but some things are missing:

print "The goblins have been zapped into toads!\n"; $gold=$gold+3; "good job you got 3 gold!\n"; &freedale

There is no print statement in front of the "good job you got 3 gold!\n"; You do not use warnings or strict, and you didn't chomp $name.

If you do not mind, I would like to use your code as a base, and then build it up myself. I am not an RPG type of guy, but I think this would be a great excersise in developing my Perl skills because it is a large scope project. A couple of ideas that came to mind such as storing the information into a database if someone wanted to save their game. /msg me if it is ok.

UPDATE

I am not condeming you for the mistakes. The critism is/was meant to be contructive. I really like the game and think it is a very worthy project.

Limbic~Region

Replies are listed 'Best First'.
Re: Re: Wizard v1.0
by Anonymous Monk on Sep 22, 2002 at 19:14 UTC
    Hey its fine by me if you use this code I don't mind although I would like to see what you do because I'd like to see the ways you modify it. I was actually thinking of posting the code on the web so all perl programmers can see it and modify it.
      I don't want to fix all the problems in my reply - I was hoping my pointers would lead you to find your own problems. Here are some more pointers to get you started.

    • Do not create a sub called stat - use uppercase or change the name because of the Perl built in stat
    • You include subs within subs, which is not what I believe you intended to do. You have the correct number of curly braces, just not where they should be - consistent indentation is the key.
    • Your sluggishness you mentioned I am betting only occurs after playing the game a while - that is because you never let a sub properly exit, you just keep calling subs within subs

      I should have something for you to look at by tonight, but if not - /msg me (you do have a real account right?)

      Limbic~Region