From: Dave Thomas Date: 2000-12-30T13:40:03+09:00 Subject: [ruby-talk:8333] Re: Hash access method tonys@myspleenklug.on.ca (tony summerfelt) writes: > On Wed, 27 Dec 2000 04:00:22 +0900, Dave Thomas wrote: > it will have x,y co-ordinates which won't change > > a 'name' (a..z) which won't change > > all the rest of the planet variables will change. (owner, number of ships, > etc) I guess I was wondering how you used all these 26 variables. If the code has specific planets hard-wired in at certain places, then having them as individual variables is one way to go. But do you ever do things like iterate over them, or access them by name? If so, you could look at structuring your data slightly differently. For example, you could keep a hash: planets = Hash.new for planet in 'a'..'a' planets[planet] = Planet.new(...) end Without knowing your application, this is obviously just idle speculation Dave