MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programminghumor/comments/1xx0hqr/lua/19spyocehdoth/?context=3
r/programminghumor • u/ExpensiveCoat8912 • 15d ago
168 comments sorted by
View all comments
Show parent comment
3
foo = {} foo[1]=1 foo["appletree"]=2 for k, v in pairs(foo) do print("foo[" .. k .. "]=" .. v ) end
0 u/ilmaestrofficial 14d ago I just wanted to know what an array is 😭 5 u/Hipnotize_nl 14d ago A table. Like everything in lua 2 u/Logogram_alt 14d ago A array is a ordered list of eliments. For example in pseudocodeA = [1, 2, 3, 4]#this is a array#in a 0-indexed arrayA[0] == 1#in a 1-indexed areayA[1] == 1 1 u/soggycheesestickjoos 14d ago it’s a list of things. “one” is just a string/text, [“one”, “two”, “three”] is an array of strings/text.
0
I just wanted to know what an array is 😭
5 u/Hipnotize_nl 14d ago A table. Like everything in lua 2 u/Logogram_alt 14d ago A array is a ordered list of eliments. For example in pseudocodeA = [1, 2, 3, 4]#this is a array#in a 0-indexed arrayA[0] == 1#in a 1-indexed areayA[1] == 1 1 u/soggycheesestickjoos 14d ago it’s a list of things. “one” is just a string/text, [“one”, “two”, “three”] is an array of strings/text.
5
A table. Like everything in lua
2
A array is a ordered list of eliments. For example in pseudocode
A = [1, 2, 3, 4]
#this is a array
#in a 0-indexed array
A[0] == 1
#in a 1-indexed areay
A[1] == 1
1
it’s a list of things. “one” is just a string/text, [“one”, “two”, “three”] is an array of strings/text.
View all comments
Show parent comment
3
u/ScallionSmooth5925 14d ago