8.1
厳然たる事実
259
"01101000", "01100101", "01101100", "01101100", "01101111", "00100000",
"01110111", "01101111", "01110010", "01101100", "01100100", "00100111"]
>>
number = bytes_in_binary.join.to_i(2)
=> 9796543849500706521102980495717740021834791
ある意味、
puts 'hello world'
はRubyプログラム番号9796543849500706521102980495717
740021834791になります
†
。逆に、Ruby プログラム番号がわかれば、簡単にそれをプログラムとして
実行することができます。
>>
number = 9796543849500706521102980495717740021834791
=> 9796543849500706521102980495717740021834791
>>
bytes_in_binary = number.to_s(2).scan(/.+?(?=.{8}
*
\z)/)
=> ["1110000", "01110101", "01110100", "01110011", "00100000", "00100111",
"01101000", "01100101", "01101100", "01101100", ...