Hello.
I'm pretty new to Crystal. By pretty new I mean a couple of weeks.
I'm attempting to create an Array. Simple enough. I've looked through the help section on Arrays. I'm wondering if it's possible (I know it is in other languages) to create an array so I'll be able to reference the index by using a string.
For example:
array_name("cory") = 24
array_name("jane") = 32
array_name("harry") = 40
And then, display the value 24 by referencing array_name("cory").
Is this possible in Crystal? If not, is there any alternative solution?
Thanks.
*cLFlaVA
----------------------------
A pirate walks into a bar with a huge ship's steering wheel down his pants.
The bartender asks, "Are you aware that you have a steering wheel down your pants?"
The pirate replies, "Arrrrr! It's driving me nuts!
I'm pretty new to Crystal. By pretty new I mean a couple of weeks.
I'm attempting to create an Array. Simple enough. I've looked through the help section on Arrays. I'm wondering if it's possible (I know it is in other languages) to create an array so I'll be able to reference the index by using a string.
For example:
array_name("cory") = 24
array_name("jane") = 32
array_name("harry") = 40
And then, display the value 24 by referencing array_name("cory").
Is this possible in Crystal? If not, is there any alternative solution?
Thanks.
*cLFlaVA
----------------------------
A pirate walks into a bar with a huge ship's steering wheel down his pants.
The bartender asks, "Are you aware that you have a steering wheel down your pants?"
The pirate replies, "Arrrrr! It's driving me nuts!