[英]How can I store two values associated with an image in an array?
I'm trying to figure out a way I can store and associate a letter (az), a value (1-10), and an image with each other. 我试图找出一种方法来存储和关联字母(az),值(1-10)和图像。 For example, lets say that associate:
例如,假设该关联:
A with 2 with letterA.png
B with 1 with letterB.png
..etc ..等等
I'm thinking that I need some kind of array. 我在想我需要某种数组。 It would be nice if I could use the letters as the indexes.
如果可以将字母用作索引,那就太好了。
Perhaps a dictionary of dictionaries? 也许是字典词典? Your question is a bit vague to provide a perfect example, but something like this:
您的问题有点模棱两可,无法提供一个完美的例子,但类似这样:
associationDictionary = {
"A" = {
"number" = 2;
"image" = "letterA.png";
}
"B" = {
"number" = 1;
"image" = "letterB.png";
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.