Skip to content

Instantly share code, notes, and snippets.

@chastell
Created January 10, 2013 19:56
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 chastell/4505253 to your computer and use it in GitHub Desktop.
Save chastell/4505253 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# encoding: UTF-8
require 'iconv'
blocks = <<end
░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░ ░░ ░░░ ░░░ ░░░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░░░ ░░░ ░░░ ░░░ ░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░
█▀█ █▀█ █▀▀ █▀█ █▀▀ █▀▀ █▀▀ █░█ █ ░█ █░█ █░░ █▀█▀█ █▀█ █▀█ █▀█ █▀█ █▀█ █▀▀ ▀█▀ █░█ █░█ █░█░█ ▀░▀ █░█ ▀▀█ ░ █▀█ ▀█░ ▀▀█ ▀▀█ █░█ █▀▀ █▀▀ ▀▀█ █▀█ █▀█
█▀█ █▀█ █░░ █░█ █▀▀ █▀▀ █░█ █▀█ █ ░█ ██░ █░░ █░█░█ █░█ █░█ █▀▀ ▀▀█ ██▀ ▀▀█ ░█░ █░█ █░█ █░█░█ ░▀░ ▀▀█ █▀▀ ░ █░█ ░█░ █▀▀ ▀▀█ ▀▀█ ▀▀█ █▀█ ░░█ █▀█ ▀▀█
▀░▀ ▀▀▀ ▀▀▀ ▀▀▀ ▀▀▀ ▀░░ ▀▀▀ ▀░▀ ▀ ▀▀ ▀░▀ ▀▀▀ ▀░▀░▀ ▀░▀ ▀▀▀ ▀░░ ░░▀ ▀░▀ ▀▀▀ ░▀░ ▀▀▀ ░▀░ ▀▀▀▀▀ ▀░▀ ░▀▀ ▀▀▀ ░ ▀▀▀ ▀▀▀ ▀▀▀ ▀▀▀ ░░▀ ▀▀▀ ▀▀▀ ░░▀ ▀▀▀ ▀▀▀
░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░ ░░ ░░░ ░░░ ░░░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░░░ ░░░ ░░░ ░░░ ░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░
end
chars = ('a'..'z').to_a + [' '] + ('0'..'9').to_a
mapping = Hash[chars.zip blocks.lines.map(&:split).transpose]
letters = Iconv.iconv('ASCII//translit//ignore', 'UTF-8', " #{$stdin.read.chomp} ").first.split ''
output = letters.map { |letter| mapping[letter] }
5.times do |row|
puts output.map { |line| line[row] }.join '░'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment