From: James Gray Date: 2008-02-12T12:50:51+09:00 Subject: Re: Beginner help - txt dungeon On Feb 11, 2008, at 7:17 PM, Jonathon Hartoon wrote: > I read your comments and some questions did in fact come up. You > commented on my file opening system. I agree with your reasoning, > as it > is very hard to work with. The reason I made it that way is because > it > was simple to code. I do not know how I would seperate it the way you > suggested. It is a bit harder. Save that for when you have learned a bit more. > The next comment was on my find_room method. > "You are using an Array as a Hash. The following line could just be:" > "@rooms[reference] # using a Hash" > > I am confused by this. Maybe some more explaination. >> class Room >> # ... ?> end => nil >> rooms = {:some_room => Room.new, :another_room => Room.new} => {:another_room=>#, :some_room=>#} >> rooms[:some_room] => # > I however do not know what "case" means. A link to some > explanation might help. >> def case_example(input) >> case input >> when "one" >> 1 >> when "two" >> 2 >> else ?> "unknown" >> end >> end => nil >> case_example "one" => 1 >> case_example "two" => 2 >> case_example "three" => "unknown" Hope that helps. James Edward Gray II