Skip to content

Instantly share code, notes, and snippets.

@skoji
Last active June 28, 2017 02:46
Show Gist options
  • Save skoji/660747f13cd2feff323aa788d51d8d61 to your computer and use it in GitHub Desktop.
Save skoji/660747f13cd2feff323aa788d51d8d61 to your computer and use it in GitHub Desktop.
ポケベル入力を読む
pockebell = [%w(わ を ん ゛ °),
%w(あ い う え お),%w(か き く け こ),%w(さ し す せ そ),
%w(た ち つ て と),%w(な に ぬ ね の),%w(は ひ ふ へ ほ),
%w(ま み む め も),%w(や ( ゆ )よ),%w(ら り る れ ろ)]
s = ARGV[0].strip.scan(/.{1,2}/).map do |c|
a,b = c.split(//)
pockebell[a.to_i][b.to_i - 1]
end
puts s.join
$ ruby pocketbell.rb 514321325525232191210443125263432143514355911513
なつかしのこくからか゛ついにふつかつなつのらおう
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment