Skip to content

Instantly share code, notes, and snippets.

@iorionda
Created April 10, 2014 08:50
Show Gist options
  • Select an option

  • Save iorionda/10358124 to your computer and use it in GitHub Desktop.

Select an option

Save iorionda/10358124 to your computer and use it in GitHub Desktop.
TABLE = {
':open_mouth:' => %w(あ か さ た な は ま や ら わ),
':grimacing:' => %w(い き し ち に ひ み り ),
':kissing:' => %w(う く す つ ぬ ふ む ゆ る ),
':scream:' => %w(え け せ て ね へ め れ ),
':hushed:' => %w(お こ そ と の ほ も よ ろ を),
':neutral_face:' => %w(ん),
}
def find_emoticon(char)
TABLE.find {|key, value| value.include?(char) }[0]
end
word = ARGV[0].each_char.map {|char| "#{char}#{find_emoticon(char)}" }.join
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment