So, I thought a nice place to start learning about arrays would be a poker system for 2-4 players. So, I started thinking along these lines:
But now I'm stuck. Don't think I can really go by this particular method. I'd like to have it so that hands_0 would be the array of [2A, 10C, 5B, 6B, 11D], or I might need a hash instead of {2 => A} or something like that. But I'm not sure how to get only an amount of hands as players. I'm sure the process is similar to the character stats, but I just can't seem to figure out the connections there.
Code:
def game_start(players)
hands[]
i = 0
j = 0
while i < players
while j < 4
hands[i] =
j++
end
i++
end
end
But now I'm stuck. Don't think I can really go by this particular method. I'd like to have it so that hands_0 would be the array of [2A, 10C, 5B, 6B, 11D], or I might need a hash instead of {2 => A} or something like that. But I'm not sure how to get only an amount of hands as players. I'm sure the process is similar to the character stats, but I just can't seem to figure out the connections there.