Jump to content

سؤال


Recommended Posts

سلام عليكم

كيف أجيب القيم الموجودة في الجدول ؟

Table = { 
  [ 1 ] = { [ 1 ] = { x } } ,
  [ 2 ] = { [ 1 ] = { x } } 
}

مثلا بجيب عدد الفيم الموجودة في Table

#Table [ 1 ] 

وذا ابي اجيب القيم الموجودة في ذا  Table [ 1 ] [ 1 ] 

كذا ؟ #Table [ 1 ] [ 1 ] 

ولا م يزبط ؟

Link to comment
local k = {
    {1, 3, 4},
    {9, 59, 1, 4, 6},
    {0, 1, 0, 4, 3},
    {{2, 4}, {1, 2, 3, 4}},
    {},
    'HI',
}

print(#k) -- 6
print(#k[1]) -- 3
print(#k[2]) -- 5
print(#k[3]) -- 5
print(#k[4]) -- 2
print(#k[4][1]) -- 2
print(#k[4][2]) -- 4
print(#k[5]) -- 0
print(#k[6]) -- 2

 

  • Like 1
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...