/lua.lua Secret
Created
May 6, 2021 16:21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 寫個簡單的函數 | |
local function func() | |
print('Hi') | |
end | |
--[[新增一個table 裡面塞入一個function 和 string | |
這邊f就是key,對應的value就是func這個函數 | |
這邊name就是key,對應的value就是iris這個字串 ]] | |
local aTable = {f = func, name = "iris"} | |
-- 在table.後面加入key就可以直接使用table中的內容 | |
aTable.f() | |
print(aTable.name) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment