Refactor p() helper function to utils
This commit is contained in:
parent
00124cd832
commit
a4c8fc7e1b
19
main.lua
19
main.lua
|
@ -36,25 +36,6 @@ local oldSeconds
|
|||
local running = true
|
||||
local lastHP
|
||||
|
||||
-- GLOBAL
|
||||
|
||||
function p(...)
|
||||
local string
|
||||
if #arg == 0 then
|
||||
string = arg[0]
|
||||
else
|
||||
string = ""
|
||||
for i,str in ipairs(arg) do
|
||||
if str == true then
|
||||
string = string.."\n"
|
||||
else
|
||||
string = string..str.." "
|
||||
end
|
||||
end
|
||||
end
|
||||
print(string)
|
||||
end
|
||||
|
||||
-- HELPERS
|
||||
|
||||
local function resetAll()
|
||||
|
|
|
@ -6,6 +6,25 @@ local EMP = 1
|
|||
|
||||
local yellow = YELLOW
|
||||
|
||||
-- GLOBAL
|
||||
|
||||
function p(...)
|
||||
local string
|
||||
if #arg == 0 then
|
||||
string = arg[0]
|
||||
else
|
||||
string = ""
|
||||
for i,str in ipairs(arg) do
|
||||
if str == true then
|
||||
string = string.."\n"
|
||||
else
|
||||
string = string..str.." "
|
||||
end
|
||||
end
|
||||
end
|
||||
print(string)
|
||||
end
|
||||
|
||||
-- GENERAL
|
||||
|
||||
function Utils.dist(x1, y1, x2, y2)
|
||||
|
|
Loading…
Reference in New Issue