@videlais/

Learning Lua: Part 2: Functions and Tables

Lua

No description

fork
loading
Files
  • main.lua
main.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
function addTwo(input)
  return input + 2
end

result = addTwo(2)
print(result)

tableDemo = {9,2,3,4,5}
print(tableDemo[1])

tableMap = {
  ["Dan"] = 33,
  ["Jophan"] = 35
}
print(tableMap["Dan"])

print("Current number of entries in the table: " .. table.getn(tableDemo))