Skip to content

Instantly share code, notes, and snippets.

@binji
Created September 23, 2014 15:58
Show Gist options
  • Save binji/76cc8343e9c0496b1751 to your computer and use it in GitHub Desktop.
Save binji/76cc8343e9c0496b1751 to your computer and use it in GitHub Desktop.
PNaCl Banner in Lua
t=0 A={64,36,35,42,33,61,59,58,126,45,44,46,32}L={0,254,195,3,224,135,231,127,
124,60,128,255,120,158,207,199,241,252,192,121,30,31,61,227,1,223,243,188,63,251
,190,193,28,156,62,248,143,7,126}D={2,3,3,4,1,5,6,7,8,9,10,1,11,12,13,14,15,16,4
,1,10,14,7,17,18,10,1,19,3,20,21,15,15,3,22,21,11,7,17,18,23,2,24,25,13,14,15,26
,27,13,21,11,7,8,28,29,19,7,25,13,2,3,30,3,8,21,11,7,25,10,29,31,7,32,13,21,19,
27,27,13,33,34,7,25,10,35,15,16,24,20,21,19,24,27,8,36,37,7,25,10,10,31,38,39,13
}B=bit32 M=math I=io.write T=string.char P=print S=M.sin C=M.cos F=M.floor b={}
for i=1,1200 do b[i]=0 end for i,v in ipairs(D)do w=L[v]for j=1,8 do if B.band(w
,1)==1 then b[160-48+i*8+j]=1 end w=B.rshift(w,1)end end P("\\x1b[2J") for w=1,
4720 do P("\\x1b[H")s=1.06*S(t*.07)^2 for i=1,1200 do x=s*((i%60)-34)+34 y=s*(F(i
/60)-15)+15 n=32 if y>=0 and y<20 and x>=0 and x<60 and b[F(y)*60+F(x)]==1 then
n=A[M.min(F(((x-30+C(t)*20)^2+(y-S(t)^2*10)^2)/(195*S(t*.2)^32+5)),12)+1]end if
i%60==0 then n=10 end I(T(n))end t=t+.005 end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment