Permalink
Browse files

Parallax background!

  • Loading branch information...
1 parent 0efd395 commit c89d208b0a9372a6c4e59456b21b40933974fa23 @pda committed Jan 14, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 asc.rb
View
3 asc.rb
@@ -74,7 +74,8 @@ def set x, y, char
@pixels[x][y] = char
end
def get x, y
- @pixels[x][y] || " "
+ n = (233.1 - 1.1 * Math.sin((x + Time.new.to_f * 10) / 5 + y / 5)).to_i
+ @pixels[x][y] || "\033[48;5;#{n}m \033[0m"
end
end

0 comments on commit c89d208

Please sign in to comment.