编辑代码

-- JSRUN引擎2.0,支持多达30种语言在线运行,全仿真在线交互输入输出。
local x = nil
local theType = type(x)
local a = {}
-- a[0] = "xxx"
table.insert(a,"foo")
-- print("result: "..a[1])


-- local random = math.random
-- local function uuid()
--     local template ='xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'
--     return string.gsub(template, '[xy]', function (c)
--         local v = (c == 'x') and random(0, 0xf) or random(8, 0xb)
--         return string.format('%x', v)
--     end)
-- end

-- print(uuid())

-- local i = 11
-- local j = 14
-- if (j-i)<=3 then
--     print("111")
-- else
--     print("222")
-- end


-- local f = {
--     ["a"] = function()
--         print("this is function a")
--     end,
--     ["b"] = function()
--         print("this is function b")
--     end,
-- }

-- if f["a"] then
--     f["a"]()
-- end
-- local curtime = os.time()
-- while true do
--     local diff_time = os.time() - curtime
--     if diff_time > 3 then
--         print("xxxx")
--         break
--     end
-- end


-- t = {1,2,3,4,5}
-- function print_t(t)
--     for k,v in pairs(t) do
--         print(k,v)
--     end
-- end


-- print_t(t)
-- print('--------------------')
-- t[1] = nil
-- print_t(t) 

-- local cur_hour = tonumber(os.date("%H"))
-- print(cur_hour)

local msgTaskActionTypeList = {
    ["login"] = true,
    ["weather"] = true,
    ["email"] = true,
    ["visit_to"] = true,
    ["grab_land"] = true,
    ["square_publish"] = true,
    ["offline_income"] = true,
}

for k,v in pairs(msgTaskActionTypeList) do
    print(tostring(v))
end