小编use*_*529的帖子

每个3个值的数据集的Ruby解决方案

所以我没有太多的Ruby知识,但需要处理一个简单的脚本.我会试着详细解释我的困境,但如果你还需要澄清,请告诉我.

我的脚本涉及每组3个数字.比方说,我们为每个人提供这三条信息:Age, Size, and Score.所以,我需要有一种方法来评估一个人是否存在某个年龄和大小.如果是这样,那么我想输出那个人的分数.

The only way I know of to keep track of this information is to create 3 separate arrays, each containing one piece of information. I can check if the age is included in one array, if so I can find its index (each value in each category will be unique -- so no "ages," "sizes," or "scores" will be repeated). I can then …

ruby arrays hash

5
推荐指数
1
解决办法
183
查看次数

标签 统计

arrays ×1

hash ×1

ruby ×1