From: "Jesús Gabriel y Galán" Date: 2011-09-30T04:45:41+09:00 Subject: Re: Variables, Arrays and Hashes. On Thu, Sep 29, 2011 at 8:54 PM, Rob V. wrote: > "Jesús Gabriel y Galán" wrote in post > #1024250: >> On Thu, Sep 29, 2011 at 8:40 PM, Rob V. wrote: >>> where: >>> >>> Any thoughts? >> Can you show a complete example in which we can see the error? >> Things to check: >> - Are you sure you are putting the keys of the hash in the arrays? >> - What does puts player1.first outputs: "Ah" or 1? >> >> Jesus. >> >> Jesus. > > I gave you an example where it doesn't work. > >>"puts deck[player1.first] >>does not return the value of the card. I've also tried created place >>holder variables without avail:" > > and I have above that: >>" puts player1.first >>it will give the appropriate first card in the hand but:" > > card in hand meaning the "Ah". > More specifically >     print player1.first > outputs ["ah"] and >     puts player1.first > outputs Ah Sorry, I meant a complete example that we can execute, that fails. We need to see how you assign cards to player1. From your description I cannot give any more advice. If print player1.first outputs ["ah"] including the brackets, I can't see how puts player1.first would output only Ah, with the capital A and no brackets or quotes, so I don't really understand what you are saying. It could be that what you have in player1 is a nested array, something like: player1 = [["Ah"]] but I can't be sure with your description. So, can you post a complete, executable snippet of code that we can check? Jesus.