Skip to content

Instantly share code, notes, and snippets.

View lua-playground's full-sized avatar

lua-playground

View GitHub Profile
@lua-playground
lua-playground / playground.lua
Created April 19, 2020 05:10
Code shared from the Lua Playground(https://lua-playground.abby.md)
today = os.date("t*") --, "%Y-%m-%d")
print(today)
time = os.time(today)
print(time)
@lua-playground
lua-playground / playground.lua
Created April 11, 2020 14:50
Code shared from the Lua Playground(https://lua-playground.abby.md)
function hello_lua()
print "Hello Lua!\n"
local a = {1,2}
local i = a[0] or 10
print(i)
end
hello_lua()
@lua-playground
lua-playground / playground.lua
Created March 27, 2020 06:34
Code shared from the Lua Playground(https://lua-playground.abby.md)
function hello_lua()
local a, _, _, d = string.match("111_222_333_8", "(%d*)_(%d*)_(%d*)_?(%d*)")
print (a, d)
local na, nb, nc, nd = string.match("111_222_333_6", "(%d*)_(%d*)_(%d*)_?(%d*)")
local id, ind = tonumber(d), tonumber(nd)
@lua-playground
lua-playground / playground.lua
Created January 23, 2020 02:59
Code shared from the Lua Playground(https://lua-playground.abby.md)
local function Print(...)
if ... == nil then return end
local Output = tostring(...)
return print(Output)--ezzz Useless tuff haha rekt ezz
end
Print("UrMomGay")
@lua-playground
lua-playground / playground.lua
Created January 23, 2020 02:55
Code shared from the Lua Playground(https://lua-playground.abby.md)
local function Print(...)
if ... == nil then return end
local Output = tostring(...)
return Output
end
Print(2)
@lua-playground
lua-playground / playground.lua
Last active December 26, 2019 11:24
Code shared from the Lua Playground(https://lua-playground.abby.md)
function hello_lua()
print "Hello Lua!"
end
hello_lua()
@lua-playground
lua-playground / playground.lua
Created October 28, 2019 15:11
Code shared from the Lua Playground(https://lua-playground.abby.md)
function eval(a,b,c,x)
return a + (b + c * x) * x
end
function regression(xa,ya)
local n = #xa
local xm = 0.0
local ym = 0.0
local x2m = 0.0
@lua-playground
lua-playground / playground.lua
Created September 11, 2019 04:43
Code shared from the Lua Playground(https://lua-playground.abby.md)
-- Variable definition:
local dis, b
-- Initialization
dis = 10
b = 0
print(dis, b)
for b = 0, dis do
print(curr)
@lua-playground
lua-playground / playground.lua
Created August 9, 2019 14:29
Code shared from the Lua Playground(https://lua-playground.abby.md)
-- variables
first = {
{value = 1},
{value = 2},
{value = 3}
}
second = {
{value = 1},
{value = 2},
{value = 3}
@lua-playground
lua-playground / playground.lua
Created August 4, 2019 19:55
Code shared from the Lua Playground(https://lua-playground.abby.md)
function hello_lua()
print "Hello Lua!"
end
hello_lua()