Skip to content

Instantly share code, notes, and snippets.

@mtimkovich
Created October 11, 2018 20:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mtimkovich/b79bf2f694c5243a11d8eb37ad65fb4c to your computer and use it in GitHub Desktop.
Save mtimkovich/b79bf2f694c5243a11d8eb37ad65fb4c to your computer and use it in GitHub Desktop.
Convert your documents to emoji
package main
import (
"fmt"
"strings"
"github.com/cespare/argf"
)
var alphamoji = map[rune]string{
'a': "πŸ…°",
'b': "πŸ…±οΈ",
'c': "Β©",
'd': "πŸ‡©",
'e': "πŸ“§",
'f': "🎏",
'g': "β›½",
'h': "β™“",
'i': "β„Ή",
'j': "πŸ—Ύ",
'k': "πŸŽ‹",
'l': "πŸ‘’",
'm': "β“‚",
'n': "β™‘",
'o': "β­•",
'p': "πŸ…Ώ",
'q': "πŸ‡Ά",
'r': "Ⓡ",
's': "⚑",
't': "🌴",
'u': "β›Ž",
'v': "β™ˆ",
'w': "πŸ‡Ό",
'x': "❌",
'y': "✌",
'z': "πŸ‡Ώ",
}
func main() {
for argf.Scan() {
line := argf.String()
line = strings.ToLower(line)
for _, c := range line {
if emoji, ok := alphamoji[c]; ok {
fmt.Print(emoji)
} else {
fmt.Printf("%c", c)
}
}
fmt.Println()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment