立石です。
fit0298 / fitec.co.jpさん(04月14日16時):
fit0298>>Hash と Array の違いがいまひとつ理解できてません。
fit0298>>
fit0298>>1) {u, p, n}.each do |t|
fit0298>>2) [u, p, n].each do |t|
fit0298>>
fit0298>>以上のような書き方で、1) だとエラーになって???です。
a = {"a" => 1, "b" => 2, "c" => 3}
a.each{|key,value|
printf("%s => %d\n")
}
という感じにHashは使います。
----------------------------------------------
Name Takaaki Tateishi
E-Mail ttate / jaist.ac.jp
URL http://www.pluto.dti.ne.jp/~tateishi/
Org School of Information Science
Japan Advanced Institute of Science and Technology (JAIST)