Skip to content

Commit

Permalink
Displays animated pattern.
Browse files Browse the repository at this point in the history
  • Loading branch information
MinhasKamal committed Jan 18, 2017
1 parent 9501e48 commit 11aa233
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions compound_eye.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Intro: Displays animated pattern.
# Source: http://code-poetry.com/compound_eye

c,q,g,p=1.45,0.5,
0.25,0.25;v=->x,t,s{
a,j=(x-c).abs,(t-q).abs
return j>p||a>2*g ? 0: (s*
-(2*p*g-p*a-g*j)).to_i+s;};(
1..1000).map{|m|;s="\n " ; (
0..21).map{|t|;(0..74). map{
|x|;d=v[x/25.0,t/21.0, m];
s+=' .:-=+*&#%@'[d%11]};
s+="\n "};sleep(0.02
);puts(s);'.:-=+*&'}

0 comments on commit 11aa233

Please sign in to comment.