Skip to content

Instantly share code, notes, and snippets.

@clashnewbm3
Created August 26, 2025 11:06
Show Gist options
  • Select an option

  • Save clashnewbm3/e7617304957f61030a7e1729676240d3 to your computer and use it in GitHub Desktop.

Select an option

Save clashnewbm3/e7617304957f61030a7e1729676240d3 to your computer and use it in GitHub Desktop.
Ruby Hacker Text Animation
print "\e[?25l"
rows, cols = `stty size`.split.map(&:to_i)
drops = Array.new(cols) { rand(rows) }
chars = ("0".."9").to_a + ("A".."Z").to_a + ("a".."z").to_a
loop do
cols.times do |i|
5.times do |line|
y = (drops[i] + line) % rows
print "\e[#{y};#{i+1}H"
print "\e[32m#{chars.sample}\e[0m"
end
drops[i] = (drops[i] + 1) % rows
end
sleep 0.05
end
at_exit { print "\e[?25h" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment