Refactor p() helper function to utils

This commit is contained in:
Kyle Coburn 2015-04-10 22:02:25 -07:00
parent 00124cd832
commit a4c8fc7e1b
2 changed files with 19 additions and 19 deletions

View File

@ -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()

View File

@ -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)