Discord
Login
Community
DARK THEME

list.lenght troubles

After populating an array whit elements lenght always returns 0?

init = function()
  tile = class
    sprite = "none"
    walkable = true
    room = 0
  end
  mapa = []
  for x = 0 to 14
    mapa.push([]) 
    for y = 0 to 14
      mapa[x].push(new tile())
    end
  end
  print(mapa)
  print(mapa.lenght)  //returns 0???
  
end

Given this code the output is

microScript 2.0 - beta
[[list],[list],[list],[list],[list],[list],[list],[list],[list],[list],[list],[list],[list],[list],[list]]
0

I must be missing something... After furder testing

init = function()
  testlist = ["tree","book","worm"]
  print(testlist.lenght)
end

Also returns 0, is this thing just broken?

Try length instead of lenght ;)

Holy shit, this is the most embarasig situation my dislexia ever goten me in xD. I usually change my font to ComicSans or OpenDyslexic, but I dont know how to do it in microStudio yet (if it is posible)

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community