Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Daft text adventure project

by arhuman (Vicar)
on May 29, 2001 at 16:16 UTC ( #83898=note: print w/replies, xml ) Need Help??


in reply to Daft text adventure project

Several points :

  • Super Search is your friend !
    'rpg' or 'adventure game' would provide useful links like
    RPG rolls or Rule Based Game Engines for example
  • Use strict shouldn't be avoid !
    Just understand that it will HELP you avoid mistake, and find somes quite tricky !
  • use strict and lexically scoped variables (my) don't prevent you to use large quantity of data
    (I'd suggest to store your data in (separated) files and load them in your lexically scoped hash, for example, at execution.)

Anyway, as an old DM and Perl lover I'd be glad to help if you have more specific questions...

"Only Bad Coders Code Badly In Perl" (OBC2BIP)

Replies are listed 'Best First'.
Re: Re: Daft text adventure project
by Tiefling (Monk) on May 29, 2001 at 16:37 UTC
    Thanks for your fast response!

    In order:

    1: SuperSearching for 'text adventure' yielded the useful fact that I'm very far from the first person to try this flavour of thing for a first project. Thanks for the further links.

    2: I appreciate the benefit of use strict - I was just wondering if the twenty or so lines of multiple-argument my commands it will require were normal.

    3: What, exactly, does 'lexically scoped' mean? As a mathematician, it suggests something like 'having a alphanumeric string value' to me - is that correct? I'm already storing my data in files and loading multiple hashes with common keys at execution.

    To explain that last bit in a little more detail, so as to help those who would help me:

    In an inheritance from the QBasic implementation, everything has an identification code, such as R001234 (for rooms) or Z054321 (for spells - S was taken by another feature, so I used my scrappy knowledge of German to implement a poor mathmo in-joke), which is used to key all the hashes for the given type. Some hashes are keyed to more than one family of codes. For example, the PC races and the general species classes ('Humanoid', 'dragon', etc) both call the same hash for their names and superspecies references, so that the routine which classifies creatures can be fed a race or a species and won't quibble.

    Thanks again,

    Tiefling
      • 2. several my ($var1,$var2,%hash1); lines is ok.
        Learn to use hash/array to reduce the number of variables and group them in useful structure.
      • 3. Super Search my frien, Super Search is your friend.
        Almost all is said in my and local??.
        In brief lexically scoped variables are a kind of local variables.

      As Jepri said you'll probably have to play with Objects,
      as he already suggested perlboot, I will only add perltoot and Object Oriented Perl
      (I haven't read it yet but I've only heard good comment about it...)

      "Only Bad Coders Code Badly In Perl" (OBC2BIP)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://83898]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2020-11-27 20:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?