Skip to content

Instantly share code, notes, and snippets.

@JoshCheek
Last active May 6, 2019 01:47
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 JoshCheek/40550393bc502d0c1cc9dcf0ee7f3bdb to your computer and use it in GitHub Desktop.
Save JoshCheek/40550393bc502d0c1cc9dcf0ee7f3bdb to your computer and use it in GitHub Desktop.
Tweetable Ruby
# https://twitter.com/josh_cheek/status/1020504489302904834
# This version is slightly different from what's in the tweet,
# I like the spacing better, it feels more smooth to me.
ruby -e'
r,w,n="\e[41m ","\e[47m ",13
print r,"\e[H\e[2J\n"
9.times{|i|
j=(13-i*1.6).to_i
k=n-j
print r,r*j,w*k,r,w*j,r*3,w*2*k,w*2,r*3,w*j,r,w*k,"\n"
}
puts
16.times{|i|
j=(i*1.9).to_i
k=n-j+i
print r*j,r,w*k,r*2,w*2*(16-i),r*2,w*k,"\n"
}
print"\e[0m"
gets'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment