Skip to content

Instantly share code, notes, and snippets.

@aienn
Created March 11, 2013 22:23

Revisions

  1. aienn created this gist Mar 11, 2013.
    39 changes: 39 additions & 0 deletions bydloscript.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,39 @@
    #usage ruby bydloscript.rb Здесь смешные надписи кириллицей лол!

    source = ARGV.join(" ").strip.split(//)
    table = { "а" => "a", "А" => "A",
    "б" => "6", "Б" => "6",
    "в" => "B", "В" => "B",
    "г" => "r", "Г" => "r",
    "д" => "D", "Д" => "D",
    "е" => "e", "Е" => "E",
    "ё" => "e", "Ё" => "E",
    "ж" => "}|{", "Ж" => "}I{",
    "з" => "3", "З" => "3",
    "и" => "u", "И" => "u",
    "й" => "u", "Й" => "u",
    "к" => "K", "К" => "K",
    "л" => "JI", "Л" => "JI",
    "м" => "M", "М" => "M",
    "н" => "H", "Н" => "H",
    "о" => "o", "О" => "O",
    "п" => "n", "П" => "n",
    "р" => "p", "Р" => "P",
    "с" => "c", "С" => "C",
    "т" => "T", "Т" => "T",
    "у" => "y", "У" => "y",
    "ф" => "(|)", "Ф" => "(|)",
    "х" => "x", "Х" => "X",
    "ц" => "LL", "Ц" => "LL",
    "ч" => "4", "Ч" => "4",
    "ш" => "LLI", "Ш" => "LLI",
    "щ" => "LLL", "Щ" => "LLL",
    "ъ" => "b", "Ъ" => "b",
    "ы" => "bI", "Ы" => "bI",
    "ь" => "b", "Ь" => "b",
    "э" => "3", "Э" => "3",
    "ю" => "I-O", "Ю" => "I-O",
    "я" => "9l", "Я" => "9l",
    " " => "_", "!" => "!" }

    puts source.map { |x| table[x] || x }.join