return(function(...)local p={"\120\083\114\109\099\050\090\061";"\110\068\118\121\099\068\106\061","\051\048\043\103\120\113\061\061","\114\118\053\118\072\113\061\061","\099\068\052\097\120\069\087\103\072\083\043\075\120\084\061\061","\110\080\097\119","\107\113\111\118\101\120\113\117";"\073\070\122\103\104\118\110\104\119\076\082\080\097\073\104\054\120\098\110\101\104\099\066\056\049\102\113\099\108\084\061\061","\066\121\116\043\120\067\105\100\066\116\061\061","\099\057\118\103\081\074\061\061";"\112\055\052\048\051\084\061\061";"\113\112\110\053\057\080\082\043\073\069\111\082\087\073\100\111\057\073\072\061","\056\080\081\068\047\057\069\102\086\112\090\061","\099\068\073\075";"\072\083\118\075\120\068\052\101","\072\069\111\100\099\048\113\061";"\083\111\049\079\109\108\108\120";"\120\088\118\101\120\113\061\061","\104\054\083\107\098\084\061\061","\051\088\052\075\051\088\118\103";"\072\050\085\078\081\057\082\048","\070\097\084\067\055\072\056\066\043\104\088\053\087\047\078\117\097\115\051\055";"\078\111\080\075\053\110\108\057\069\077\108\107\075\079\090\099\069\071\052\057\051\053\088\048\102\067\103\107\083\073\084\079\069\081\121\105\106\052\074\073\047\070\056\084\113\066\066\087\106\086\077\054\111\056\086\089\048\113\075\082\109\085\054\082\057\106\086\054\056\074\117\088\084\102\105\090\097\066\087\102\121\084\061\061","\105\053\067\109\055\112\071\080\101\082\103\061";"\112\055\052\098\120\057\119\061";"\106\070\113\066\117\099\120\102\085\097\115\082\069\101\078\109\070\084\061\061";"\106\043\106\076\106\065\082\075\106\112\073\047\087\103\114\073\099\084\061\061";"\051\057\068\120";"";"\085\088\087\113\089\122\120\109\099\068\101\087\073\065\043\104\106\074\061\061";"\089\110\050\066\051\075\067\079\110\068\051\055\085\074\061\061";"\072\088\073\103\099\057\073\103\051\112\085\097\051\083\114\043","\122\073\080\082\081\057\082\068\073\080\073\120\120\048\118\055";"\112\055\052\100\099\083\085\043\108\074\061\061";"\087\084\073\065\117\106\068\082\118\115\083\086\103\101\082\077\101\073\072\047\119\090\104\076\117\055\121\074\067\098\055\097\073\056\122\057\110\078\115\083\055\114\102\075\097\100\103\120\081\098\115\070\070\104\073\112\106\054\086\098\117\097\111\118\120\079\109\121\097\103\119\066\068\112\083\077\048\079\086\104\122\070\114\085\107\077\099\074\090\069\049\067\054\089\119\103\078\075\081\078\050\057\112\097\081\053\066\121\050\056\048\055\101\108\083\097\043\077\087\099\072\078\052\047";"\112\055\052\101\120\112\085\097\110\068\118\121\099\068\106\061","\072\083\073\101\099\050\120\043";"\110\068\118\076\081\084\061\061","\074\073\050\104\085\113\061\061";"\066\116\061\061","\073\068\118\101\072\068\073\078\090\080\085\043\110\068\073\056\110\068\073\065\090\113\061\061";"\111\088\104\113\078\114\081\104\056\122\080\050\113\085\081\081\057\079\089\104\067\085\083\054\067\083\075\113\049\112\077\083\104\072\047\083\051\084\106\061";"\051\088\097\097\072\116\061\061";"\107\118\048\055\105\082\068\081\080\081\057\112\121\101\122\056\104\102\103\065\082\107\048\116\119\050\051\118\070\105\082\074\053\077\099\073\084\085\106\061";"\047\073\076\066\050\089\116\099\099\108\107\075\081\100\057\072\109\052\050\081\098\076\099\050\054\084\055\080\054\051\075\103\100\072\122\098","\110\057\082\084\051\057\087\079";"\112\074\108\056\052\076\078\119\057\051\086\067","\070\047\053\114\110\043\072\061";"\120\088\055\097\110\068\087\105";"\070\069\085\103\072\080\110\043\110\074\061\061";"\087\083\085\113\085\106\106\061"}local function C(C)return p[C-47519]end for C,V in ipairs({{1,51};{1,15};{16;51}})do while V[1]<V[2]do p[V[1]],p[V[2]],V[1],V[2]=p[V[2]],p[V[1]],V[1]+1,V[2]-1 end end do local C=table.concat local V=string.len local q=string.char local r=table.insert local N=type local z=p local Y=string.sub local n={U=17;T=48,x=25;H=28,z=19;W=13,a=33,b=44,m=47;k=58;q=16;p=23,o=9,s=15,M=62;["\047"]=3,E=7;X=54;i=40;I=21,S=38;v=5;A=36,g=52;["\057"]=22;y=34;C=2;["\050"]=55,["\053"]=1;u=59,["\043"]=37,G=60;J=0,d=41;Q=26;B=14;["\051"]=24;w=56;c=27;t=32;n=29;j=20,r=49;K=46,F=18;["\055"]=53;R=57;["\048"]=39;Y=12,h=11,P=4;f=31,O=43,["\054"]=63,D=6;e=45;V=10;["\056"]=35,["\052"]=61;Z=8,L=51;["\049"]=42,N=50;l=30}local b=math.floor for p=1,#z,1 do local a=z[p]if N(a)=="\115\116\114\105\110\103"then local N=V(a)local u={}local P=1 local W=0 local m=0 while P<=N do local p=Y(a,P,P)local C=n[p]if C then W=W+C*64^(3-m)m=m+1 if m==4 then m=0 local p=b(W/65536)local C=b((W%65536)/256)local V=W%256 r(u,q(p,C,V))W=0 end elseif p=="\061"then r(u,q(b(W/65536)))if P>=N or Y(a,P+1,P+1)~="\061"then r(u,q(b((W%65536)/256)))end break end P=P+1 end z[p]=C(u)end end end do local p=true local V=string[C(47532)]local q=function()error(C(47524))end local r=false local N=pcall(function()r=true end)and r local z=math[C(47549)]local Y=table[C(47554)]local n=table and table[C(47529)]or unpack local b=z(3,65)local a=0 local u=0 local P={pcall(function()local p=5893812-C(47531)^4665487 return C(47564)/p end)}local W=P[2]local m=tonumber((V(tostring(W),C(47543)))())for q=1,b,1 do local r=math[C(47549)](1,100)local N=z(0,255)local Y=z(1,r)local P=z(1,2)==1 local k=W:gsub(C(47543),C(47523)..(tostring(z(0,10000))..C(47523)))local j={pcall(function()if z(1,2)==1 or q==b then local q=tonumber((V(tostring(({pcall(function()local p=3360871-C(47540)^6356162 return C(47534)/p end)})[2]),C(47543)))())p=p and m==q end if P then error(k,0)end local a={}for p=1,r,1 do a[p]=z(0,255)end a[Y]=N return n(a)end)}if P then p=p and(j[1]==false and j[2]==k)else p=p and j[1]a=(a+j[Y+1])%256 u=(u+N)%256 end end p=p and a==u if p then else repeat return(function()while true do l1,l2=l2,l1 q()end end)()until true while true do l2=z(1,6)if l2>2 then l2=tostring(l1)else l1=l2 end end return end end return(function(p,q,r,N,z,Y,n,a,j,V,b,P,m,W,u,k,e,E)P,u,E,W,m,j,b,k,V,e,a=0,function()P=P+1 a[P]=1 return P end,function(p,C)local q=W(C)local r=function(r,N,z,Y)return V(p,{r,N;z;Y},C,q)end return r end,function(p)for C=1,#p,1 do a[p[C]]=a[p[C]]+1 end if r then local V=r(true)local q=z(V)q[C(47568)],q[C(47545)],q[C(47559)]=p,m,function()return-894875 end return V else return N({},{[C(47545)]=m;[C(47568)]=p;[C(47559)]=function()return-894875 end})end end,function(p)local C,V=1,p[1]while V do a[V],C=a[V]-1,C+1 if 0==a[V]then a[V],b[V]=nil,nil end V=p[C]end end,function(p,C)local q=W(C)local r=function(...)return V(p,{...},C,q)end return r end,{},function(p)a[p]=a[p]-1 if a[p]==0 then a[p],b[p]=nil,nil end end,function(V,r,N,z)local L,m,h,x,D,g,W,I,X,v,j,i,f,B,c,P,a,w,Z,S,M,J,n while V do if V<9823769 then if V<5035139 then if V<1615743 then if V<789549 then if V<360937 then P=nil n={}V=p[C(47561)]m=nil W=nil else P=b[N[3]]W=126 a=P*W P=257 n=a%P b[N[3]]=n V=9826092 end else if V<957860 then c=C(47547)M=9843291694031 x=P(c,M)L=W[x]X=m[L]L=X()V=L and 16230384 or 16179182 j=L else S=not D B=B+v n=B<=J n=S and n S=B>=J S=D and S n=S or n S=6998742 V=n and S n=9088277 V=V or n end end else if V<4880998 then if V<4006126 then f=C(47570)n=C(47566)B=u()X=nil J=u()V={}b[B]=V v=u()V=e(13483420,{B;x,c;m})D={}g=nil m=k(m)h=C(47568)b[J]=V V={}M=nil b[v]=V V=p[n]M=19759600060386 w=b[v]m=C(47539)j=nil S={[h]=w;[f]=g}n=V(D,S)W=n I=nil V=E(7609576,{v,B,i,x,c;J})L=nil B=k(B)Z=nil P=V v=k(v)x=k(x)I=2993683565284 X=C(47552)i=k(i)V=p[m]c=k(c)J=k(J)i=4111482916597 c=C(47569)j=p[X]x=P(c,M)L=W[x]M=14939425912409 x=C(47533)x=j[x]c=C(47556)X={x(j,L)}m=V(q(X))V=m()x=24367166838949 m=V D=23972017788725 L=C(47562)v=24891168840333 X=P(L,x)j=W[X]Z=14568973677824 V=m[j]x=P(c,M)M=C(47530)L=W[x]c=P(M,i)i=C(47538)x=W[c]M=P(i,I)I=C(47565)c=W[M]i=P(I,Z)B=4225303023455 Z=C(47553)M=W[i]I=P(Z,B)B=C(47528)i=W[I]J=8481745510107 Z=P(B,J)J=C(47560)I=W[Z]B=P(J,v)v=C(47527)Z=W[B]J=P(v,D)B=W[J]X={[L]=x;[c]=M,[i]=I;[Z]=B}M=9843291694031 j=V(X)c=C(47547)x=P(c,M)L=W[x]X=m[L]L=X()j=L V=L and 7541990 or 4670094 else c=C(47551)M=11112493262957 x=P(c,M)L=W[x]X=m[L]V=7541990 j=X end else if V<4978305 then W=32 c=2 P=b[N[3]]a=P%W m=b[N[4]]L=b[N[2]]B=b[N[3]]Z=B-a i=13 B=32 I=Z/B M=i-I x=c^M X=L/x j=m(X)m=4294967296 W=j%m x=1 j=2 m=j^a P=W/m m=b[N[4]]L=P%x x=4294967296 X=L*x j=m(X)a=nil m=b[N[4]]X=m(P)W=j+X c=256 i=256 j=65536 m=W%j L=65536 X=W-m j=X/L L=256 X=m%L x=m-X L=x/c c=256 x=j%c M=j-x m=nil c=M/i M={X;L,x,c}c=nil b[N[1]]=M j=nil W=nil L=nil P=nil X=nil V=10123061 x=nil else X=C(47521)x=C(47522)j=p[X]c=19639337305970 L=P(x,c)X=W[L]V=j[X]j=V()V=791576 end end end else if V<7576681 then if V<6976336 then if V<5839517 then D=1 n=1 B=#Z V=j(n,B)B=V V=X(Z,B)J=V V=b[i]v=J-D n=L(v)B=nil V[J]=n V=11722086 J=nil else x=M S=C(47555)D=p[S]S=C(47537)v=D[S]D=v(a,x)v=b[N[6]]S=v()J=D+S B=J+X J=256 Z=B%J V=11992942 J=W[P]S=1 x=nil X=Z D=X+S v=m[D]B=J..v W[P]=B end else if V<7069717 then S=B V=S Z[S]=V V=1156131 S=nil else V=4987032 end end else if V<8703325 then if V<7634737 then V=b[N[1]]W=V a=r[1]P=r[2]V=W[P]V=V and 14440377 or 15049676 else n=nil V=nil W=n a=r P=V m=C(47544)j=C(47544)n=p[m]X=C(47536)m=C(47535)V=n[m]m=u()b[m]=V L=C(47555)n=p[j]j=C(47549)V=n[j]n=p[X]x=u()c=u()j=V X=C(47520)V=n[X]X=V n=p[L]L=C(47526)i=u()V=n[L]L=V V=0 b[x]=V V=2 n=1 b[c]=V V={}M=V V={}B=256 b[i]=V J=B V=0 I=V V={}Z=V V=1156131 B=1 v=B B=0 D=v<B B=n-v end else if V<9464114 then n=#Z B=0 V=n==B V=5038746 else L=nil V=11259224 m=nil X=nil end end end end else if V<13490332 then if V<11051177 then if V<10476980 then if V<9831611 then W=1 P=b[N[3]]a=P~=W V=a and 4945047 or 789528 else W=C(47536)P=p[W]W=C(47520)a=P[W]W=b[N[1]]P={a(W)}V=p[C(47567)]n={q(P)}end else if V<10613597 then M=11718102133409 c=C(47558)x=P(c,M)L=W[x]X=m[L]L=X()j=L V=L and 15418327 or 14642111 else x=C(47525)M=C(47557)c=10235219420476 j=C(47550)V=p[j]L=P(x,c)i=25447384079507 X=W[L]L=C(47552)j=V(X)j=C(47539)V=p[j]X=p[L]c=P(M,i)x=W[c]c=C(47533)c=X[c]L={c(X,x)}j=V(q(L))V=j()V=221190 end end else if V<11955588 then if V<11655271 then V=p[C(47546)]n={P}else n=#Z B=0 V=n==B V=V and 3479146 or 5038746 end else if V<12947399 then Z=not I M=M+i x=M<=c x=Z and x Z=M>=c Z=I and Z x=Z or x Z=6853329 V=x and Z x=9802027 V=V or x else a=b[N[1]]n=#a a=0 V=n==a V=V and 13540766 or 10123061 end end end else if V<14910803 then if V<14417810 then if V<13538606 then c=16538276281386 j=C(47550)V=p[j]x=C(47542)L=P(x,c)X=W[L]j=V(X)V=221190 else P=b[N[2]]W=69 a=P*W P=24203953100813 n=a+P P=1 a=35184372088832 V=n%a b[N[2]]=V a=b[N[3]]V=789528 n=a~=P end else if V<14592440 then V=11259224 else V=j and 10649413 or 13506973 end end else if V<15738835 then if V<15375744 then j=35184372088832 V={}L=255 b[N[2]]=V n=b[N[3]]x=C(47555)m=n M=1 n=P%j b[N[4]]=n i=M X=P%L L=2 j=X+L b[N[5]]=j L=p[x]x=C(47548)X=L[x]M=0 L=X(a)I=i<M c=L X=C(47563)W[P]=X V=11992942 X=251 x=1 M=x-i else i=7775201827913 M=C(47541)c=P(M,i)x=W[c]L=m[x]x=false X=L==x j=X V=14642111 end else if V<16185062 then c=C(47551)V=16230384 M=11112493262957 x=P(c,M)L=W[x]X=m[L]j=X else V=j and 10607940 or 4987032 end end end end end end V=#z return q(n)end,function(p,C)local q=W(C)local r=function(r,N)return V(p,{r,N},C,q)end return r end,{}return(j(8477443,{}))(q(n))end)(getfenv and getfenv()or _ENV,unpack or table[C(47529)],newproxy,setmetatable,getmetatable,select,{...})end)(...) 

Lua online compiler

Write, Run & Share Lua code online using OneCompiler's Lua online compiler for free. It's one of the robust, feature-rich online compilers for Lua language, running the latest Lua version 5.4. Getting started with the OneCompiler's Lua editor is easy and fast. The editor shows sample boilerplate code when you choose language as Lua and start coding.

Taking inputs (stdin)

OneCompiler's Lua online editor supports stdin and users can give inputs to programs using the STDIN textbox under the I/O tab. Following is a sample Lua program which takes name as input and prints hello message with your name.

name = io.read("*a")
print ("Hello ", name)

About Lua

Lua is a light weight embeddable scripting language which is built on top of C. It is used in almost all kind of applications like games, web applications, mobile applications, image processing etc. It's a very powerful, fast, easy to learn, open-source scripting language.

Syntax help

Variables

  • By default all the variables declared are global variables
  • If the variables are explicitly mentioned as local then they are local variables.
  • Lua is a dynamically typed language and hence only the values will have types not the variables.

Examples

-- global variables
a = 10

-- local variables

local x = 30
Value TypeDescription
numberRepresents numbers
stringRepresents text
nilDifferentiates values whether it has data or not
booleanValue can be either true or false
functionRepresents a sub-routine
userdataRepresents arbitary C data
threadRepresents independent threads of execution.
tableCan hold any value except nil

Loops

1. While:

While is also used to iterate a set of statements based on a condition. Usually while is preferred when number of iterations are not known in advance.

while(condition)
do
--code
end

2. Repeat-Until:

Repeat-Until is also used to iterate a set of statements based on a condition. It is very similar to Do-While, it is mostly used when you need to execute the statements atleast once.

repeat
   --code
until( condition )

3. For:

For loop is used to iterate a set of statements based on a condition.

for init,max/min value, increment
do
   --code
end

Functions

Function is a sub-routine which contains set of statements. Usually functions are written when multiple calls are required to same set of statements which increase re-usuability and modularity.

optional_function_scope function function_name( argument1, argument2, argument3........, argumentn)
--code
return params with comma seperated
end