読者です 読者をやめる 読者になる 読者になる

ミームの死骸を待ちながら

We are built as gene machines and cultured as meme machines, but we have the power to turn against our creators. We, alone on earth, can rebel against the tyranny of the selfish replicators. - Richard Dawkins "Selfish Gene"

We are built as gene machines and cultured as meme machines, but we have the power to turn against our creators.
We, alone on earth, can rebel against the tyranny of the selfish replicators.
- Richard Dawkins "Selfish Gene"

配列からHashを生成


配列aryにデータを溜めていって、最後にまとめてHashにしてしまう。keyとvalueを交互に溜めていくこと。

count = 0
ary = []
for i in 0..10 do
  count += 1
  ary << count
  ary << "hogeNo.#{count}"
end
newhash = Hash[*ary]

> newhash[5]
=> hogeNo.5

とやる。