リファクタリング

■このサイトは面白い
http://refactormycode.com/


ここから学んだ例1
C:\WINDOWS\system32>irb
irb(main):001:0> (0..9).to_a
=> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
irb(main):003:0> ("a".."z").to_a
=> ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n",
"o", "p", "q", "
r", "s", "t", "u", "v", "w", "x", "y", "z"]


ちなみに乱数発生もあった
rand.to_s << Time.now.tv_sec.to_s


500.times { puts((1..16).collect { '1234567890'.split('')[rand(10)] }.join) }
(1..16)の使い方がいい