tonys / myspleenklug.on.ca wrote: >well, i don't know how much detail your ships have, but mine don't really >have any, they are just numbers associated with a planet or a fleet. Mine have a size, location, owner (I guess that would be which fleet they belong to), and they will soon have a current speed. > >this is the python planet class: (snip) Looks great, and easy to translate directly to Ruby. >and this is the code that init's all the planets: (snip) > >nothing fancy. no arrays, or hashes, or hashes of arrays, etc. the python >code is very clean, readable, but most of all logical. i'm hoping the finished >ruby code will be also > >i'm trying to keep it very 'object oriented'. i don't feel that anything >that belongs to a 'planet' should be outside of it's class... That makes sense, and we're not suggesting otherwise. However, I would suggest that there is something bigger than a planet that holds all the planets. Perhaps it's a galaxy, or maybe it's just the game itself. Either way, it would be handy for this larger object to be able to treat the entire group of planets as a single entity, such as to pass it to a routine for searching or saving to disk. The array/hash solution does that (along with the other benefits). Kevin