fork(1) download
  1. puts "Ruby veresion #{RUBY_VERSION}"
  2.  
  3. str = "Hello, how are you?"
  4.  
  5. hash = Hash[ (:a .. :z).zip(1 .. 26) ]
  6.  
  7. puts "encoding..."
  8.  
  9. puts str.downcase.split("").map { |char|
  10. hash[char.to_sym] || char
  11. }.join(" ")
  12.  
Success #stdin #stdout 0.01s 8060KB
stdin
Standard input is empty
stdout
Ruby veresion 1.9.3
encoding...
8 5 12 12 15 ,   8 15 23   1 18 5   25 15 21 ?