Last active
June 28, 2017 02:46
-
-
Save skoji/660747f13cd2feff323aa788d51d8d61 to your computer and use it in GitHub Desktop.
ポケベル入力を読む
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ruby pocketbell.rb 514321325525232191210443125263432143514355911513 | |
なつかしのこくからか゛ついにふつかつなつのらおう |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment