Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

neo88

array or hash?

This topic is 5417 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am writing a rpg in perl. Before you jump all over me though, it is actually coming along really well... I was quite suprised at how easy it was to translate the perl language into a sutible langauge for game programming. Anyways, I am doing the AI for my game right now, and I need to know if I should store the information in an array or a hash. Since this is OO perl, I am kinda leaning toward hash. But, here''s the type of data I want stored: health = 0,1; weapons = 0,1; food = 0,1; happiness = 0,1; victories = 0,1; defeats = 0,1; tired = 0,1; as you can see, these are simply boolean values, 0 if false, 1 if true. Would this type of information be better stored in an array or a hash? Are there any other types of values I should include?

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!