From: Kevin Smith Date: 2001-02-04T12:05:38+09:00 Subject: [ruby-talk:10333] Re: Multi-dimensional Array Mike Wilson wrote: >Personally, I think I'd start off with a Map class >(maybe module), where you can set and get x,y >positions (being careful to account for multiple >locations (for rooms)), everything would subclass >that (or maybe you could mix it in). Then, I'd create >a Monster class, a Hero class, and a Room class. Strong agreement. >Each would carry it's own position, plus whatever >other info you'd want (strength, etc). You could >override +,-,etc to move the creature or whatever. Well, I'm not much for overriding operators, but I like the rest. I would read the file line-by-line, remembering what line (row) I'm on, and setting each object's column appropriately. Then again, you might actually end up with a hybrid. Perhaps the walls would best be stored in a grid, but the monsters and hero(s) would be objects that would just store a location. Kevin